Skip to content

feat: bottom sheet component#231

Merged
Tania-Roche-SWO merged 5 commits intomainfrom
feature/MPT-18946/bottom-sheet-component
Mar 18, 2026
Merged

feat: bottom sheet component#231
Tania-Roche-SWO merged 5 commits intomainfrom
feature/MPT-18946/bottom-sheet-component

Conversation

@Tania-Roche-SWO
Copy link
Contributor

Adding Bottom Sheet custom component:

  • placement
  • animation on open / close
  • close on tapping outside
  • close on drag down by the "handle"
  • snap points
  • drag treshold
  • dark overlay (tappable)
  • keyboard integration

NOTE: contents of file CreateChatModal.tsx are placeholder! A lot of it will be replaced, it was just there to verify that steps in "wizard" behave as expected

Screenshots

image

Copy link
Collaborator

@GitchalWoo GitchalWoo left a comment

Choose a reason for hiding this comment

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

Two more things:
BottomSheet creates PanResponder in useRef with closure over SHEET_MAX_HEIGHT
SHEET_MAX_HEIGHT is derived from the snapHeight prop, but PanResponder.create() captures it in a closure at initial render only. If snapHeight changes, the PanResponder will use a stale value. This is a functional bug — consider recreating the pan responder when snapHeight changes, or using a useRef for the computed height.

Missing testID props
Per CONVENTIONS.md: "Add testID props for E2E testing."

BottomSheet.tsx — no testID on Modal, Pressable backdrop, or Animated.View
CreateChatModal.tsx — no testID on any interactive element (buttons, input, touchables)
CreateChatButton.tsx — the existing button still has no testID

@Tania-Roche-SWO
Copy link
Contributor Author

Tania-Roche-SWO commented Mar 18, 2026

Two more things: BottomSheet creates PanResponder in useRef with closure over SHEET_MAX_HEIGHT SHEET_MAX_HEIGHT is derived from the snapHeight prop, but PanResponder.create() captures it in a closure at initial render only. If snapHeight changes, the PanResponder will use a stale value. This is a functional bug — consider recreating the pan responder when snapHeight changes, or using a useRef for the computed height.

Missing testID props Per CONVENTIONS.md: "Add testID props for E2E testing."

BottomSheet.tsx — no testID on Modal, Pressable backdrop, or Animated.View CreateChatModal.tsx — no testID on any interactive element (buttons, input, touchables) CreateChatButton.tsx — the existing button still has no testID

Added ref for SHEET_MAX_HEIGHT, although it is not really an issue and would not cause a bug. Because the only time this value could change, is when user opens this screen on device with different dimensions, or when we create another bottom sheet on another screen and may give different snapHeight. Either way, this value will always be same on the same screen on the same device. But for the peace of mind, I have added ref and replaced where necessary.

Added testID to the instance of in CreateChatModal.tsx, added testID to the button as well.

Copy link
Collaborator

@GitchalWoo GitchalWoo left a comment

Choose a reason for hiding this comment

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

Fantastic

@Tania-Roche-SWO Tania-Roche-SWO merged commit 75ccd71 into main Mar 18, 2026
4 checks passed
@Tania-Roche-SWO Tania-Roche-SWO deleted the feature/MPT-18946/bottom-sheet-component branch March 18, 2026 17:26
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