Skip to content
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

Merged

Conversation

Paul-vrn
Copy link
Contributor

@Paul-vrn Paul-vrn commented Oct 17, 2023

Summary

Modified BottomSheetFlatList style in app/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 from app/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

  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • Includes text changes and localization file updates
  • Have tested against the 5 core themes to ensure consistency between them.

Device Information

This PR was tested on: Iphone 15, iOS 17.0 (using Simulator 15.0 on Mac)

Screenshots

one_server two_servers three_servers four_servers
multiple_servers.mov

Release Note

NONE

@mattermost-build
Copy link
Contributor

Hello @Paul-vrn,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.


import {BUTTON_HEIGHT} from '@app/screens/bottom_sheet';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Suggested change
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';
Copy link
Contributor

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),
Copy link
Contributor

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

@enahum enahum added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Oct 17, 2023
@lindalumitchell lindalumitchell added the Build Apps for PR Build the mobile app for iOS and Android to test label Oct 18, 2023
@mattermost-build
Copy link
Contributor

Building app in separate branch.

@mattermost-build mattermost-build removed the Build Apps for PR Build the mobile app for iOS and Android to test label Oct 18, 2023
Copy link
Contributor

@lindalumitchell lindalumitchell left a 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. 👍

@mattermost-build
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

@enahum enahum added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter Lifecycle/1:stale 3: QA Review Requires review by a QA tester labels Oct 30, 2023
@enahum enahum merged commit 2583b47 into mattermost:main Oct 30, 2023
4 checks passed
@amyblais amyblais added this to the v2.11.0 milestone Oct 30, 2023
fewva pushed a commit to fewva/mattermost-mobile that referenced this pull request Jan 12, 2024
cyrusjc pushed a commit to cyrusjc/mattermost-mobile that referenced this pull request May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request Contributor Hacktoberfest release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RN: Servers bottom sheet cuts off information unneccesarily
7 participants