From 2635291187077f7c0d8f2b656923e2eeac7a0d68 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 3 Sep 2026 04:13:26 +0530 Subject: [PATCH 01/13] test: restore Maestro reaction-list regression coverage and sniffler mapping Keeps the Maestro flow, data-setup helper, sniffler entry and the reactions-tab testIDs it targets. Drops prior app/ fix attempts. --- .maestro/scripts/data-setup.js | 16 +++++ .../reaction-list-scroll-to-last-user.yaml | 65 +++++++++++++++++++ .sniffler/test-map.json | 4 ++ app/containers/ReactionsList/index.tsx | 4 +- 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 .maestro/tests/room/reaction-list-scroll-to-last-user.yaml diff --git a/.maestro/scripts/data-setup.js b/.maestro/scripts/data-setup.js index 39c239541d..3f42e48f9d 100644 --- a/.maestro/scripts/data-setup.js +++ b/.maestro/scripts/data-setup.js @@ -180,6 +180,21 @@ const post = (endpoint, username, password, body) => { return response; }; +// Creates `count` new users and has each of them react to `messageId` with `emoji`. +// Used to reproduce "who reacted" sheets with many reactors (e.g. the reaction-list +// scroll/clipping regression). Created users are tracked by createUser() for cleanup. +const reactAsNewUsers = (count, messageId, emoji) => { + const reactors = []; + + for (let i = 0; i < count; i++) { + const reactor = createUser(); + post('chat.react', reactor.username, reactor.password, { messageId, emoji, shouldReact: true }); + reactors.push(reactor); + } + + return reactors; +}; + const createDM = (username, password, otherUsername) => { login(username, password); @@ -261,6 +276,7 @@ output.utils = { sendMessage, getProfileInfo, post, + reactAsNewUsers, login, getDeepLink, createDM, diff --git a/.maestro/tests/room/reaction-list-scroll-to-last-user.yaml b/.maestro/tests/room/reaction-list-scroll-to-last-user.yaml new file mode 100644 index 0000000000..072530e916 --- /dev/null +++ b/.maestro/tests/room/reaction-list-scroll-to-last-user.yaml @@ -0,0 +1,65 @@ +appId: ${APP_ID} +name: Reaction List Scroll To Last User +jsEngine: graaljs +onFlowStart: + - runFlow: '../../helpers/setup.yaml' +onFlowComplete: + - evalScript: ${output.utils.deleteCreatedUsers()} +tags: + - test-12 + +--- +- evalScript: ${output.user = output.utils.createUser()} +- evalScript: ${output.room = output.utils.createRandomRoom(output.user.username, output.user.password)} +- evalScript: ${output.randomMessage = 'reaction-list-message-' + output.random()} +- evalScript: ${output.message = output.utils.sendMessage(output.user.username, output.user.password, output.room.name, output.randomMessage)} + +- runFlow: + file: '../../helpers/login-with-deeplink.yaml' + env: + USERNAME: ${output.user.username} + PASSWORD: ${output.user.password} +- runFlow: + file: '../../helpers/navigate-to-room.yaml' + env: + ROOM: ${output.room.name} + +- extendedWaitUntil: + visible: + text: '.*${output.randomMessage}.*' + timeout: 60000 + +# Create 15 users and have them react to the message with a thumbs-up emoji +- evalScript: ${output.reactors = output.utils.reactAsNewUsers(15, output.message.message._id, ':thumbsup:')} + +- extendedWaitUntil: + visible: + id: 'message-reaction-:thumbsup:' + timeout: 60000 +- longPressOn: + id: 'message-reaction-:thumbsup:' +- extendedWaitUntil: + visible: + id: reactionsList + timeout: 60000 +- tapOn: + id: 'reactions-tab-:thumbsup:' +- waitForAnimationToEnd: + timeout: 1000 + +# Scroll until the last user is visible in the list of users who reacted to the message. +- evalScript: ${output.userFound = 0} +- repeat: + while: + true: ${output.userFound == 0} + commands: + - swipe: + from: + id: 'usersList-:thumbsup:' + direction: up + - runFlow: + when: + visible: + text: ${output.reactors[14].username} + commands: + - evalScript: ${output.userFound = 1} diff --git a/.sniffler/test-map.json b/.sniffler/test-map.json index 8fa1d38489..b47fda3a07 100644 --- a/.sniffler/test-map.json +++ b/.sniffler/test-map.json @@ -269,6 +269,10 @@ "test": ".maestro/tests/room/message-markdown-click.yaml", "dependsOn": ["app/views/RoomView/**", "app/containers/markdown/**", "app/sagas/room.js"] }, + { + "test": ".maestro/tests/room/reaction-list-scroll-to-last-user.yaml", + "dependsOn": ["app/containers/ReactionsList/**", "app/containers/ActionSheet/**"] + }, { "test": ".maestro/tests/room/quote-thread-message.yaml", "dependsOn": [ diff --git a/app/containers/ReactionsList/index.tsx b/app/containers/ReactionsList/index.tsx index 865c4c6e74..9842621c53 100644 --- a/app/containers/ReactionsList/index.tsx +++ b/app/containers/ReactionsList/index.tsx @@ -64,14 +64,14 @@ const ReactionsList = ({ reactions }: IReactionsListProps) => { const renderTabItem = (tab: IRoute, color: string) => { if (tab.key === 'all') { return ( - + {I18n.t('All')} ); } if (tab.emoji) { return ( - + {tab.usernames?.length} From 7c55d712ffc68e7fef09c839470c35bb886f87ca Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 3 Sep 2026 04:14:00 +0530 Subject: [PATCH 02/13] fix: keep bottom-sheet content clear of the Android nav bar Centralizes nav-bar clearance in getSheetContentPaddingBottom: safe-area bottom everywhere, plus the header height on Android for non-scrollable full-height sheets. Drops AttachmentActionSheet's local compensation and EmojiPicker's in-sheet margin in favor of the shared padding. --- app/containers/ActionSheet/ActionSheet.tsx | 13 ++++- .../ActionSheet/BottomSheetContent.tsx | 4 +- .../useActionSheetDetents.test.tsx | 50 ++++++++++++++++- .../ActionSheet/useActionSheetDetents.ts | 14 +++++ app/containers/EmojiPicker/index.tsx | 2 +- .../Attachments/AttachmentActionSheet.tsx | 14 +---- .../AttachmentActionSheet.test.tsx.snap | 55 +++++-------------- .../__snapshots__/ReactionsList.test.tsx.snap | 12 ++++ 8 files changed, 106 insertions(+), 58 deletions(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index ce1a59e404..f06bbba318 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -11,13 +11,14 @@ import { } from 'react-native'; import { TrueSheet } from '@lodev09/react-native-true-sheet'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useTheme } from '../../theme'; import { isAndroid, isIOS } from '../../lib/methods/helpers'; import { Handle } from './Handle'; import { type TActionSheetOptions } from './Provider'; import BottomSheetContent from './BottomSheetContent'; -import { HANDLE_HEIGHT, useActionSheetDetents } from './useActionSheetDetents'; +import { HANDLE_HEIGHT, getSheetContentPaddingBottom, useActionSheetDetents } from './useActionSheetDetents'; import { useActionSheetItemHeight } from './useActionSheetItemHeight'; import styles from './styles'; @@ -32,12 +33,19 @@ const ActionSheet = memo( const [data, setData] = useState({} as TActionSheetOptions); const [isVisible, setIsVisible] = useState(false); const [contentHeight, setContentHeight] = useState(0); + const { bottom } = useSafeAreaInsets(); const onCloseSnapshotRef = useRef(undefined); const itemHeight = useActionSheetItemHeight(); const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { - setContentHeight(layout.height); + const padding = getSheetContentPaddingBottom({ + bottom, + fullContainer: data.fullContainer, + hugContent: data.hugContent, + scrollEnabled + }); + setContentHeight(Math.max(0, layout.height - padding)); }; const hide = () => { @@ -133,6 +141,7 @@ const ActionSheet = memo( ref={sheetRef} detents={detents} maxHeight={maxHeight} + insetAdjustment='automatic' backgroundColor={colors.surfaceLight} cornerRadius={16} dimmed diff --git a/app/containers/ActionSheet/BottomSheetContent.tsx b/app/containers/ActionSheet/BottomSheetContent.tsx index 8047220567..566ccddd86 100644 --- a/app/containers/ActionSheet/BottomSheetContent.tsx +++ b/app/containers/ActionSheet/BottomSheetContent.tsx @@ -11,6 +11,7 @@ import styles from './styles'; import * as List from '../List'; import Touch from '../Touch'; import { useActionSheetItemHeight } from './useActionSheetItemHeight'; +import { getSheetContentPaddingBottom } from './useActionSheetDetents'; interface IBottomSheetContentProps { hasCancel?: boolean; @@ -40,6 +41,7 @@ const BottomSheetContent = memo( const { bottom } = useSafeAreaInsets(); const height = useActionSheetItemHeight(); const minHeightStyle = isAndroid || !contentMinHeight ? undefined : { minHeight: contentMinHeight }; + const paddingBottom = getSheetContentPaddingBottom({ bottom, fullContainer, hugContent, scrollEnabled }); const renderFooter = () => hasCancel ? ( @@ -78,7 +80,7 @@ const BottomSheetContent = memo( return ( {children} diff --git a/app/containers/ActionSheet/useActionSheetDetents.test.tsx b/app/containers/ActionSheet/useActionSheetDetents.test.tsx index 2564b0cbd7..6b4bb93982 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.test.tsx +++ b/app/containers/ActionSheet/useActionSheetDetents.test.tsx @@ -1,6 +1,14 @@ import { renderHook } from '@testing-library/react-native'; -import { HANDLE_HEIGHT, useActionSheetDetents } from './useActionSheetDetents'; +import { HANDLE_HEIGHT, getSheetContentPaddingBottom, useActionSheetDetents } from './useActionSheetDetents'; + +let mockIsAndroid = false; + +jest.mock('../../lib/methods/helpers/deviceInfo', () => ({ + get isAndroid() { + return mockIsAndroid; + } +})); describe('useActionSheetDetents', () => { const windowHeight = 1000; @@ -86,3 +94,43 @@ describe('useActionSheetDetents', () => { expect(result.current.detents).toEqual([0.15]); }); }); + +describe('getSheetContentPaddingBottom', () => { + const bottom = 24; + + beforeEach(() => { + mockIsAndroid = false; + }); + + it('returns the safe-area bottom when no flags are set', () => { + expect(getSheetContentPaddingBottom({ bottom })).toBe(bottom); + }); + + it('returns the safe-area bottom on iOS even for a full-container sheet', () => { + expect(getSheetContentPaddingBottom({ bottom, fullContainer: true, scrollEnabled: false })).toBe(bottom); + }); + + it('adds the handle height on Android for a non-scrollable full-container sheet', () => { + mockIsAndroid = true; + + expect(getSheetContentPaddingBottom({ bottom, fullContainer: true, scrollEnabled: false })).toBe(bottom + HANDLE_HEIGHT); + }); + + it('returns the safe-area bottom on Android for a scrollable full-container sheet', () => { + mockIsAndroid = true; + + expect(getSheetContentPaddingBottom({ bottom, fullContainer: true, scrollEnabled: true })).toBe(bottom); + }); + + it('returns the safe-area bottom on Android when hugging content', () => { + mockIsAndroid = true; + + expect(getSheetContentPaddingBottom({ bottom, fullContainer: true, hugContent: true, scrollEnabled: false })).toBe(bottom); + }); + + it('returns the safe-area bottom on Android for a regular sheet', () => { + mockIsAndroid = true; + + expect(getSheetContentPaddingBottom({ bottom })).toBe(bottom); + }); +}); diff --git a/app/containers/ActionSheet/useActionSheetDetents.ts b/app/containers/ActionSheet/useActionSheetDetents.ts index 5bc2b90abf..be309c673e 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.ts +++ b/app/containers/ActionSheet/useActionSheetDetents.ts @@ -1,11 +1,25 @@ import type { SheetDetent } from '@lodev09/react-native-true-sheet'; import { useMemo } from 'react'; +import { isAndroid } from '../../lib/methods/helpers'; + const ACTION_SHEET_MIN_HEIGHT_FRACTION = 0.15; const ACTION_SHEET_MAX_HEIGHT_FRACTION = 0.75; const SCROLL_ENABLED_THRESHOLD = 0.6; export const HANDLE_HEIGHT = 28; +export const getSheetContentPaddingBottom = ({ + bottom, + fullContainer, + hugContent, + scrollEnabled +}: { + bottom: number; + fullContainer?: boolean; + hugContent?: boolean; + scrollEnabled?: boolean; +}): number => bottom + (isAndroid && fullContainer && !hugContent && !scrollEnabled ? HANDLE_HEIGHT : 0); + function normalizeSnapsToDetents(snaps: (string | number)[]): number[] { return snaps .slice(0, 3) diff --git a/app/containers/EmojiPicker/index.tsx b/app/containers/EmojiPicker/index.tsx index d69e67c1e6..3622a26d4c 100644 --- a/app/containers/EmojiPicker/index.tsx +++ b/app/containers/EmojiPicker/index.tsx @@ -62,7 +62,7 @@ const EmojiPicker = ({ return ( setParentWidth(e.nativeEvent.layout.width)}> {searching ? ( diff --git a/app/containers/MessageComposer/components/Attachments/__snapshots__/AttachmentActionSheet.test.tsx.snap b/app/containers/MessageComposer/components/Attachments/__snapshots__/AttachmentActionSheet.test.tsx.snap index d55336309d..3664b4b313 100644 --- a/app/containers/MessageComposer/components/Attachments/__snapshots__/AttachmentActionSheet.test.tsx.snap +++ b/app/containers/MessageComposer/components/Attachments/__snapshots__/AttachmentActionSheet.test.tsx.snap @@ -11,14 +11,9 @@ exports[`Story Snapshots: File should match snapshot 1`] = ` > Date: Thu, 3 Sep 2026 04:20:34 +0530 Subject: [PATCH 03/13] move test to shard 6 --- .maestro/tests/room/reaction-list-scroll-to-last-user.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.maestro/tests/room/reaction-list-scroll-to-last-user.yaml b/.maestro/tests/room/reaction-list-scroll-to-last-user.yaml index 072530e916..e4b242c392 100644 --- a/.maestro/tests/room/reaction-list-scroll-to-last-user.yaml +++ b/.maestro/tests/room/reaction-list-scroll-to-last-user.yaml @@ -6,7 +6,7 @@ onFlowStart: onFlowComplete: - evalScript: ${output.utils.deleteCreatedUsers()} tags: - - test-12 + - test-6 --- - evalScript: ${output.user = output.utils.createUser()} From 405f984f2147b433f5983a869d68391b2bf29ff1 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 3 Sep 2026 04:21:27 +0530 Subject: [PATCH 04/13] fix: use sheet scrollable flag for bottom clearance padding BottomSheetContent was deciding the extra header-height padding from the hook's scrollEnabled, which is false for any snap-driven sheet. Attachment sheet is natively scrollable (flex-fitted below header), so it got double bottom padding. Children sheets now use the same isScrollable flag TrueSheet receives. --- app/containers/ActionSheet/ActionSheet.tsx | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index f06bbba318..46a8f8485b 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -38,16 +38,6 @@ const ActionSheet = memo( const itemHeight = useActionSheetItemHeight(); - const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { - const padding = getSheetContentPaddingBottom({ - bottom, - fullContainer: data.fullContainer, - hugContent: data.hugContent, - scrollEnabled - }); - setContentHeight(Math.max(0, layout.height - padding)); - }; - const hide = () => { if (!isVisible) return; sheetRef.current?.dismiss(); @@ -124,6 +114,17 @@ const ActionSheet = memo( const hasSnaps = !!effectiveSnaps?.length; const disableContentPanning = data?.enableContentPanningGesture === false; const isScrollable = hasOptions || (hasSnaps && !disableContentPanning); + const contentScrollEnabled = hasOptions ? scrollEnabled : isScrollable; + + const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { + const padding = getSheetContentPaddingBottom({ + bottom, + fullContainer: data.fullContainer, + hugContent: data.hugContent, + scrollEnabled: contentScrollEnabled + }); + setContentHeight(Math.max(0, layout.height - padding)); + }; const contentMinHeight = data.fullContainer && effectiveSnaps?.length @@ -161,7 +162,7 @@ const ActionSheet = memo( fullContainer={data.fullContainer} hugContent={data.hugContent} contentMinHeight={isIOS ? contentMinHeight : undefined} - scrollEnabled={scrollEnabled}> + scrollEnabled={contentScrollEnabled}> {data?.children} From 9c4255c40a69741e3b991f41ed96a3905815b37e Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:29:43 +0530 Subject: [PATCH 05/13] added default bottom for home button device --- app/containers/ActionSheet/useActionSheetDetents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/containers/ActionSheet/useActionSheetDetents.ts b/app/containers/ActionSheet/useActionSheetDetents.ts index be309c673e..4504591aab 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.ts +++ b/app/containers/ActionSheet/useActionSheetDetents.ts @@ -18,7 +18,7 @@ export const getSheetContentPaddingBottom = ({ fullContainer?: boolean; hugContent?: boolean; scrollEnabled?: boolean; -}): number => bottom + (isAndroid && fullContainer && !hugContent && !scrollEnabled ? HANDLE_HEIGHT : 0); +}): number => Math.max(32, bottom) + (isAndroid && fullContainer && !hugContent && !scrollEnabled ? HANDLE_HEIGHT : 0); function normalizeSnapsToDetents(snaps: (string | number)[]): number[] { return snaps From 0454feba30f69831ad70fcfdadd067c5e6ed74ad Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:56:55 +0530 Subject: [PATCH 06/13] test fix --- app/containers/ActionSheet/useActionSheetDetents.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/containers/ActionSheet/useActionSheetDetents.test.tsx b/app/containers/ActionSheet/useActionSheetDetents.test.tsx index 6b4bb93982..7f6feb4898 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.test.tsx +++ b/app/containers/ActionSheet/useActionSheetDetents.test.tsx @@ -96,7 +96,7 @@ describe('useActionSheetDetents', () => { }); describe('getSheetContentPaddingBottom', () => { - const bottom = 24; + const bottom = 32; beforeEach(() => { mockIsAndroid = false; From 74fa3997c6047130bf1ffe0dda089ad32c517701 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Sat, 5 Sep 2026 03:06:41 +0530 Subject: [PATCH 07/13] remove insetAdjustment --- app/containers/ActionSheet/ActionSheet.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index 46a8f8485b..4392157a16 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -142,7 +142,6 @@ const ActionSheet = memo( ref={sheetRef} detents={detents} maxHeight={maxHeight} - insetAdjustment='automatic' backgroundColor={colors.surfaceLight} cornerRadius={16} dimmed From fd5c5482d04276f5d2f45e9e88ba480df5a5fe7a Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Sat, 5 Sep 2026 03:06:50 +0530 Subject: [PATCH 08/13] using 48 as bottom --- app/containers/ActionSheet/useActionSheetDetents.test.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/containers/ActionSheet/useActionSheetDetents.test.tsx b/app/containers/ActionSheet/useActionSheetDetents.test.tsx index 7f6feb4898..36bc7e5233 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.test.tsx +++ b/app/containers/ActionSheet/useActionSheetDetents.test.tsx @@ -96,12 +96,16 @@ describe('useActionSheetDetents', () => { }); describe('getSheetContentPaddingBottom', () => { - const bottom = 32; + const bottom = 48; beforeEach(() => { mockIsAndroid = false; }); + it('falls back to the minimum padding when the safe-area bottom is 0', () => { + expect(getSheetContentPaddingBottom({ bottom: 0 })).toBe(32); + }); + it('returns the safe-area bottom when no flags are set', () => { expect(getSheetContentPaddingBottom({ bottom })).toBe(bottom); }); From d0d668f4b9df4bde6b9440e8de8b6cca58280a52 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Sat, 5 Sep 2026 03:07:00 +0530 Subject: [PATCH 09/13] move value to variable and added comment --- app/containers/ActionSheet/useActionSheetDetents.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/containers/ActionSheet/useActionSheetDetents.ts b/app/containers/ActionSheet/useActionSheetDetents.ts index 4504591aab..a513516543 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.ts +++ b/app/containers/ActionSheet/useActionSheetDetents.ts @@ -7,6 +7,8 @@ const ACTION_SHEET_MIN_HEIGHT_FRACTION = 0.15; const ACTION_SHEET_MAX_HEIGHT_FRACTION = 0.75; const SCROLL_ENABLED_THRESHOLD = 0.6; export const HANDLE_HEIGHT = 28; +// home-button devices returns a 0 bottom inset, hiding content off-screen without this floor. +const SHEET_CONTENT_MIN_BOTTOM_PADDING = 32; export const getSheetContentPaddingBottom = ({ bottom, @@ -18,7 +20,9 @@ export const getSheetContentPaddingBottom = ({ fullContainer?: boolean; hugContent?: boolean; scrollEnabled?: boolean; -}): number => Math.max(32, bottom) + (isAndroid && fullContainer && !hugContent && !scrollEnabled ? HANDLE_HEIGHT : 0); +}): number => + Math.max(SHEET_CONTENT_MIN_BOTTOM_PADDING, bottom) + + (isAndroid && fullContainer && !hugContent && !scrollEnabled ? HANDLE_HEIGHT : 0); function normalizeSnapsToDetents(snaps: (string | number)[]): number[] { return snaps From 801b22bcf903d0f5fa866a4e45534253cef0afe8 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Sat, 5 Sep 2026 03:30:19 +0530 Subject: [PATCH 10/13] fix: keep bottom padding in dynamic sheet detent --- app/containers/ActionSheet/ActionSheet.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index 4392157a16..ef27d2562d 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -11,14 +11,13 @@ import { } from 'react-native'; import { TrueSheet } from '@lodev09/react-native-true-sheet'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; -import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useTheme } from '../../theme'; import { isAndroid, isIOS } from '../../lib/methods/helpers'; import { Handle } from './Handle'; import { type TActionSheetOptions } from './Provider'; import BottomSheetContent from './BottomSheetContent'; -import { HANDLE_HEIGHT, getSheetContentPaddingBottom, useActionSheetDetents } from './useActionSheetDetents'; +import { HANDLE_HEIGHT, useActionSheetDetents } from './useActionSheetDetents'; import { useActionSheetItemHeight } from './useActionSheetItemHeight'; import styles from './styles'; @@ -33,7 +32,6 @@ const ActionSheet = memo( const [data, setData] = useState({} as TActionSheetOptions); const [isVisible, setIsVisible] = useState(false); const [contentHeight, setContentHeight] = useState(0); - const { bottom } = useSafeAreaInsets(); const onCloseSnapshotRef = useRef(undefined); const itemHeight = useActionSheetItemHeight(); @@ -117,13 +115,7 @@ const ActionSheet = memo( const contentScrollEnabled = hasOptions ? scrollEnabled : isScrollable; const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { - const padding = getSheetContentPaddingBottom({ - bottom, - fullContainer: data.fullContainer, - hugContent: data.hugContent, - scrollEnabled: contentScrollEnabled - }); - setContentHeight(Math.max(0, layout.height - padding)); + setContentHeight(layout.height); }; const contentMinHeight = From 20313f400a008b2907b7b1372ccd2baae1c0e40b Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 8 Sep 2026 18:58:14 +0530 Subject: [PATCH 11/13] revert few change --- app/containers/ActionSheet/ActionSheet.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index ef27d2562d..c75e6d3e1c 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -35,6 +35,9 @@ const ActionSheet = memo( const onCloseSnapshotRef = useRef(undefined); const itemHeight = useActionSheetItemHeight(); + const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { + setContentHeight(layout.height); + }; const hide = () => { if (!isVisible) return; @@ -112,11 +115,6 @@ const ActionSheet = memo( const hasSnaps = !!effectiveSnaps?.length; const disableContentPanning = data?.enableContentPanningGesture === false; const isScrollable = hasOptions || (hasSnaps && !disableContentPanning); - const contentScrollEnabled = hasOptions ? scrollEnabled : isScrollable; - - const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { - setContentHeight(layout.height); - }; const contentMinHeight = data.fullContainer && effectiveSnaps?.length @@ -153,7 +151,7 @@ const ActionSheet = memo( fullContainer={data.fullContainer} hugContent={data.hugContent} contentMinHeight={isIOS ? contentMinHeight : undefined} - scrollEnabled={contentScrollEnabled}> + scrollEnabled={scrollEnabled}> {data?.children} From e15a2d7b90aa7185015087cf48385ff876a9a448 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 8 Sep 2026 19:33:04 +0530 Subject: [PATCH 12/13] readded getSheetContentPaddingBottom in handleContentLayout --- app/containers/ActionSheet/ActionSheet.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index c75e6d3e1c..4392157a16 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -11,13 +11,14 @@ import { } from 'react-native'; import { TrueSheet } from '@lodev09/react-native-true-sheet'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useTheme } from '../../theme'; import { isAndroid, isIOS } from '../../lib/methods/helpers'; import { Handle } from './Handle'; import { type TActionSheetOptions } from './Provider'; import BottomSheetContent from './BottomSheetContent'; -import { HANDLE_HEIGHT, useActionSheetDetents } from './useActionSheetDetents'; +import { HANDLE_HEIGHT, getSheetContentPaddingBottom, useActionSheetDetents } from './useActionSheetDetents'; import { useActionSheetItemHeight } from './useActionSheetItemHeight'; import styles from './styles'; @@ -32,12 +33,10 @@ const ActionSheet = memo( const [data, setData] = useState({} as TActionSheetOptions); const [isVisible, setIsVisible] = useState(false); const [contentHeight, setContentHeight] = useState(0); + const { bottom } = useSafeAreaInsets(); const onCloseSnapshotRef = useRef(undefined); const itemHeight = useActionSheetItemHeight(); - const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { - setContentHeight(layout.height); - }; const hide = () => { if (!isVisible) return; @@ -115,6 +114,17 @@ const ActionSheet = memo( const hasSnaps = !!effectiveSnaps?.length; const disableContentPanning = data?.enableContentPanningGesture === false; const isScrollable = hasOptions || (hasSnaps && !disableContentPanning); + const contentScrollEnabled = hasOptions ? scrollEnabled : isScrollable; + + const handleContentLayout = ({ nativeEvent: { layout } }: LayoutChangeEvent) => { + const padding = getSheetContentPaddingBottom({ + bottom, + fullContainer: data.fullContainer, + hugContent: data.hugContent, + scrollEnabled: contentScrollEnabled + }); + setContentHeight(Math.max(0, layout.height - padding)); + }; const contentMinHeight = data.fullContainer && effectiveSnaps?.length @@ -151,7 +161,7 @@ const ActionSheet = memo( fullContainer={data.fullContainer} hugContent={data.hugContent} contentMinHeight={isIOS ? contentMinHeight : undefined} - scrollEnabled={scrollEnabled}> + scrollEnabled={contentScrollEnabled}> {data?.children} From 29ab4ce099e6567b983e9f2bb22b3aca06c38fc5 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Thu, 10 Sep 2026 19:04:59 +0530 Subject: [PATCH 13/13] remove a comment... --- app/containers/ActionSheet/useActionSheetDetents.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/containers/ActionSheet/useActionSheetDetents.ts b/app/containers/ActionSheet/useActionSheetDetents.ts index a513516543..be9ecd767e 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.ts +++ b/app/containers/ActionSheet/useActionSheetDetents.ts @@ -7,7 +7,6 @@ const ACTION_SHEET_MIN_HEIGHT_FRACTION = 0.15; const ACTION_SHEET_MAX_HEIGHT_FRACTION = 0.75; const SCROLL_ENABLED_THRESHOLD = 0.6; export const HANDLE_HEIGHT = 28; -// home-button devices returns a 0 bottom inset, hiding content off-screen without this floor. const SHEET_CONTENT_MIN_BOTTOM_PADDING = 32; export const getSheetContentPaddingBottom = ({