Skip to content

feat: basic setup react-native-true-sheet#6970

Open
OtavioStasiak wants to merge 13 commits intodevelopfrom
test.poc-a11y-bottom-shet
Open

feat: basic setup react-native-true-sheet#6970
OtavioStasiak wants to merge 13 commits intodevelopfrom
test.poc-a11y-bottom-shet

Conversation

@OtavioStasiak
Copy link
Contributor

@OtavioStasiak OtavioStasiak commented Feb 6, 2026

Proposed changes

Use react-native-true-sheet instead of the Discord bottom sheet, because react-native-true-sheet works as expected in accessibility (a11y) terms.

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-1809

How to test or reproduce

  • Open the app;
  • Open the action sheet in places such as Change Workspace, message actions, and server history;

Screenshots

iPhone portrait iPhone landscape
Simulator Screenshot - iPhone 16 - 2026-02-10 at 11 55 07 Simulator Screenshot - iPhone 16 - 2026-02-10 at 16 56 49
iPad portrait iPad landscape
Simulator Screenshot - iPad (A16) - 2026-02-10 at 14 28 13 Simulator Screenshot - iPad (A16) - 2026-02-10 at 14 28 22
iPad mini portrait iPad mini landscape
Simulator Screenshot - iPad mini (A17 Pro) - 2026-02-10 at 17 15 26 Simulator Screenshot - iPad mini (A17 Pro) - 2026-02-10 at 17 03 52
Android portrait Android landscape
Screenshot_1770752018 Screenshot_1770753454
Android tablet portrait Android tablet landscape
Screenshot_20260210-183407_RocketChat Experimental Screenshot_20260210-183420_RocketChat Experimental

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Action sheet now exposes imperative showActionSheet/hideActionSheet for programmatic control.
  • Improvements

    • Responsive, content-driven detents and simplified sizing for better layout across screens and font scales.
    • Streamlined show/hide lifecycle with tap-to-dismiss handle, keyboard dismissal on open, and light haptic on present.
    • Improved list behavior on Android and refreshed action list surface styling.
  • Localization

    • Added “Hide action sheet” entry.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Replaces BottomSheet with react-native-true-sheet, adds detents-based height calculation and responsive layout, introduces useActionSheetDetents and detent utilities, swaps BottomSheet-specific components for RN primitives, updates mocks and dependency, and exposes imperative show/hide methods on the ActionSheet.

Changes

Cohort / File(s) Summary
Core ActionSheet Migration
app/containers/ActionSheet/ActionSheet.tsx, app/containers/ActionSheet/BottomSheetContent.tsx
Replaced BottomSheet usage with TrueSheet, transitioned sizing to detents-driven logic, removed BottomSheet refs/backdrop, swapped BottomSheetView/BottomSheetFlatList for View/FlatList, simplified show/hide lifecycle, and exposed imperative showActionSheet/hideActionSheet.
Detent Logic & Hook
app/containers/ActionSheet/useActionSheetDetents.ts, app/containers/ActionSheet/utils.ts
Added useActionSheetDetents hook and detent utilities (getDetents, normalizeSnapsToDetents) plus constants (min/max fractions, handle/cancel heights) to compute sheet detents from data, window/content metrics and snaps.
TextInput Simplification
app/containers/TextInput/FormTextInput.tsx
Removed BottomSheetTextInput fallback; now uses React Native TextInput directly.
Mocks & Test Setup
jest.setup.js
Replaced mock for @discord/bottom-sheet with a mock for @lodev09/react-native-true-sheet, exposing a forwardRef TrueSheet with present, dismiss, resize, and a trivial provider.
Dependencies & Patches
package.json, patches/@discord+bottom-sheet+4.6.1.patch
Swapped dependency to @lodev09/react-native-true-sheet; removed previously patched files from @discord/bottom-sheet (BottomSheet, handle container, useStableCallback, animate util).
i18n
app/i18n/locales/en.json
Added "Hide_action_sheet": "Hide action sheet" localization entry.

Sequence Diagram

sequenceDiagram
    participant User
    participant ActionSheet
    participant Layout as useResponsiveLayout
    participant DetentCalc as useActionSheetDetents
    participant TrueSheet

    User->>ActionSheet: showActionSheet(options)
    ActionSheet->>ActionSheet: set data, set isVisible
    ActionSheet->>Layout: request windowHeight & fontScale
    Layout-->>ActionSheet: windowHeight, fontScale
    ActionSheet->>DetentCalc: compute detents(data, windowHeight, contentHeight, itemHeight, insets)
    DetentCalc-->>ActionSheet: detents[]
    ActionSheet->>TrueSheet: present(detents)
    TrueSheet-->>User: sheet shown
    User->>TrueSheet: dismiss
    TrueSheet->>ActionSheet: onDidDismiss
    ActionSheet->>ActionSheet: reset state, call data.onClose?
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped from BottomSheets to a truer land,
Detents tucked softly in my paw and hand,
I tapped to show, I nudged to hide,
The sheet now listens to a gentle guide,
Hooray — it folds and flutters on command!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing BottomSheet with react-native-true-sheet library as a foundational setup.
Linked Issues check ✅ Passed The changes comprehensively implement the migration from Discord BottomSheet to react-native-true-sheet across ActionSheet components, FormTextInput, and configuration files.
Out of Scope Changes check ✅ Passed All changes directly support the library migration: component rewrites, new utility functions, dependency updates, and mock configuration adjustments are all scope-aligned.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

156-156: ⚠️ Potential issue | 🟠 Major

Remove unused @gorhom/bottom-sheet devDependency

@gorhom/bottom-sheet is not referenced anywhere in the codebase and should be removed. It does not appear in any imports, Storybook configuration, or build configs.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a0e332 and f72572a.

⛔ Files ignored due to path filters (2)
  • ios/Podfile.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: OtavioStasiak
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6499
File: app/containers/ServerItem/index.tsx:34-36
Timestamp: 2025-12-17T15:56:22.578Z
Learning: In the Rocket.Chat React Native codebase, for radio button components on iOS, include the selection state ("Selected"/"Unselected") in the accessibilityLabel instead of using accessibilityState={{ checked: hasCheck }}, because iOS VoiceOver has known issues with accessibilityRole="radio" + accessibilityState that prevent correct state announcement.
📚 Learning: 2026-02-05T13:55:00.974Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6930
File: package.json:101-101
Timestamp: 2026-02-05T13:55:00.974Z
Learning: In this repository, the dependency on react-native-image-crop-picker should reference the RocketChat fork (RocketChat/react-native-image-crop-picker) with explicit commit pins, not the upstream ivpusic/react-native-image-crop-picker. Update package.json dependencies (and any lockfile) to point to the fork URL and a specific commit, ensuring edge-to-edge Android fixes are included. This pattern should apply to all package.json files in the repo that declare this dependency.

Applied to files:

  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: format
🔇 Additional comments (1)
package.json (1)

28-28: ⚠️ Potential issue | 🟠 Major

Update @lodev09/react-native-true-sheet to the latest stable version.

The package is pinned to ~3.6.0, but the latest stable release is 3.8.2 (as of February 2026). The current tilde range only allows patch updates within 3.6.x and will not fetch available patches in 3.8.x. Update to ~3.8.2 to receive critical bug fixes and improvements, or verify that 3.6.0 is intentionally locked for specific compatibility reasons.

⛔ Skipped due to learnings
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6930
File: package.json:101-101
Timestamp: 2026-02-05T13:55:06.688Z
Learning: The RocketChat/Rocket.Chat.ReactNative repository uses a fork of react-native-image-crop-picker (RocketChat/react-native-image-crop-picker) with custom Android edge-to-edge fixes, not the upstream ivpusic/react-native-image-crop-picker package. Dependencies should reference commit pins from the RocketChat fork.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@github-actions
Copy link

Android Build Available

Rocket.Chat Experimental 4.70.0.108256

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNS6EVU8WlITCrgd-JZw8OEcDneZFCxSBf4om0dwgpev-N5GL0ofAx-D6ooAIpp4FHhayAZwGBvWgHRXRk2t

@Rohit3523 Rohit3523 mentioned this pull request Feb 12, 2026
10 tasks
@github-actions
Copy link

iOS Build Available

Rocket.Chat Experimental 4.70.0.108260

@github-actions
Copy link

Android Build Available

Rocket.Chat Experimental 4.70.0.108259

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNRKIdtpSqJ-N60cInXpnkEDVN6EdYgvLW8Z8Q2eNoKsov1J8C-FTMpApDdt_1FAC1iPJ9HfwOAAco3tXWkf

@github-actions
Copy link

Android Build Available

Rocket.Chat Experimental 4.70.0.108276

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNRvIeSDPOEqoXCEFIbzFkL6RxGLiBasgVbg4ECmCVUn2OqCzawmGCvJUBz-6FhrXELWDwSghi_iJzt4yOok

@github-actions
Copy link

iOS Build Available

Rocket.Chat Experimental 4.70.0.108277

@github-actions
Copy link

Android Build Available

Rocket.Chat Experimental 4.70.0.108282

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNTpnE9MOqHVUQGv9CB1w4_iZxgSHEYOhinswbLQCwqnmgPHuw2JoKPKVJDQxRPgud0mDCY0dkT1d7Fr7nsN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants