-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MM-54599] Fix Servers bottom sheet #7609
[MM-54599] Fix Servers bottom sheet #7609
Conversation
…t's < 60% of the screen
…:Paul-vrn/mattermost-mobile into MM-54599_fix-servers-bottom-sheet-height
|
||
import {BUTTON_HEIGHT} from '@app/screens/bottom_sheet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import {BUTTON_HEIGHT} from '@app/screens/bottom_sheet'; | |
import {BUTTON_HEIGHT} from '@screens/bottom_sheet'; |
And sort the import
import {useSafeAreaInsets} from 'react-native-safe-area-context'; | ||
|
||
import {BUTTON_HEIGHT, TITLE_HEIGHT} from '@app/screens/bottom_sheet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
import {BUTTON_HEIGHT, TITLE_HEIGHT} from '@app/screens/bottom_sheet'; |
import ServerIcon from '@components/server_icon'; | ||
import {useServerUrl} from '@context/server'; | ||
import {useTheme} from '@context/theme'; | ||
import {subscribeAllServers} from '@database/subscription/servers'; | ||
import {subscribeUnreadAndMentionsByServer, type UnreadObserverArgs} from '@database/subscription/unreads'; | ||
import {useIsTablet} from '@hooks/device'; | ||
import {BUTTON_HEIGHT, TITLE_HEIGHT} from '@screens/bottom_sheet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep
const maxSnapPoint = Math.min( | ||
maxScreenHeight, | ||
bottomSheetSnapPoint(registeredServers.current.length, 75, bottom) + TITLE_HEIGHT + BUTTON_HEIGHT + | ||
(registeredServers.current.filter((s: ServersModel) => s.lastActiveAt).length * 42), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the 42 to a constant name, same as the 75 to clearly identify what it means
…n servers/index.tsx
…:Paul-vrn/mattermost-mobile into MM-54599_fix-servers-bottom-sheet-height
Building app in separate branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified on the PR builds on Android and iOS that after adding enough servers to cause the list to scroll, I can open the bottom sheet to view the servers, pull it up to expand the list taller, and scroll through the server list without issue. Also double-checked that functions from that list such as editing server name, removing server, and logging out of a server work as expected with no issues. 👍
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
Summary
Modified
BottomSheetFlatList
style inapp/screens/home/channel_list/servers/server_list/index.tsx
to add a bottom margin and prevent the "+Add server" bottom sheet from covering a server item.Modified
onPress
function fromapp/screens/home/channel_list/servers/index.tsx
to pre-calculate the "Your servers" Bottom sheet's height depending on the number of server items (and pushAlertText if present) up to a height of 60% of the screen. Above 60%, the sheet can be extended up to 80% of the screen.Ticket Link
Fixes mattermost/mattermost#24668
Jira MM-54599
Checklist
Device Information
This PR was tested on: Iphone 15, iOS 17.0 (using Simulator 15.0 on Mac)
Screenshots
multiple_servers.mov
Release Note