Skip to content

feat(bottom-sheet): opt-in floating variant#919

Draft
CassioMG wants to merge 7 commits into
mainfrom
cg-floating-bottom-sheet
Draft

feat(bottom-sheet): opt-in floating variant#919
CassioMG wants to merge 7 commits into
mainfrom
cg-floating-bottom-sheet

Conversation

@CassioMG

@CassioMG CassioMG commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in floating variant to the shared BottomSheet wrapper (@gorhom/bottom-sheet v5) — a detached card with small transparent margins on the sides and bottom, all four corners rounded, and no drag handle — and adopts it on several experimental sheets.

The variant is opt-in via a new floating prop (default false), so all existing (~52) sheets render exactly as before.

How it works

When floating is set, the wrapper uses gorhom's native detached mode:

  • detached + bottomInset = insets.bottom + 8 (lifts the card off the bottom, safe on devices without a home indicator)
  • style={{ marginHorizontal: 8 }} (side gaps)
  • backgroundStyle.borderRadius = 32 (all-corner rounding)
  • handleComponent={null} (no drag pill — dismiss via the X button / backdrop tap)

Sheets adopted

  • History transaction details — scrollable + absolutely-positioned footer
  • Manage wallets — fixed 80% snap
  • Trustline info (swap flow) — dynamic size
  • Sign transaction details (swap + dApp signing) — fixed 90% snap
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-07-02.at.21.13.18.mov

Known limitation

On the fixed-snap Sign-transaction-details sheet, the scroll content's bottom corners stay square against the rounded card. gorhom doesn't round-clip content for detached sheets (the rounded corners are a background layer only) and its content view is absolutely positioned, so masking the scroll content to the rounded bottom isn't straightforward. Content fits and scrolls correctly; only the corner mask is missing. Left as a follow-up.

Testing

  • Unit tests for the wrapper's floating props, the footer rounding, and the reservedVerticalPx height math.
  • Manually verified each adopted sheet on an iOS simulator (iPhone 17 Pro).
  • Full suite green.

🤖 Generated with Claude Code

CassioMG and others added 7 commits July 2, 2026 21:19
Declare and forward the forwardRef ref param onto the host View so React
does not warn about a one-arg render function; keeps test output pristine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A floating card's absolutely-positioned scroll footer sits over the
rounded bottom edge; round and clip its bottom corners when floating so
an opaque footer background does not square off the card. Adds tests for
the footer rounding in both floating and classic modes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adopt the floating variant on the scrollable transaction-details sheet.
The footer drops its redundant safe-area bottom padding when floating,
since the card's bottom inset already clears the safe area.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adopt the floating variant on the fixed-snap manage-wallets sheet.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adopt the floating variant on the transaction-details sheet in both the
swap and dApp-signing flows.

These are fixed-snap sheets whose scroll content is sized by
BottomSheetAdaptiveContainer. gorhom reduces a modal sheet's container
height by its insets, so a floating sheet's card is shorter than the raw
window; calculateScrollableMaxHeight gains a reservedVerticalPx option and
the container reserves the floating bottom inset (plus the header gap) so
scroll content fits the card instead of overflowing its rounded bottom.

Known limitation: gorhom does not round-clip content for detached sheets
(the rounded corners are a background layer only) and its content view is
absolutely positioned, so the scroll content's bottom corners remain square
against the rounded card. Accepted for now.

Shared the floating margin/radius constants via config/constants.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@CassioMG CassioMG changed the title feat(bottom-sheet): opt-in floating variant + adopt on key sheets feat(bottom-sheet): opt-in floating variant Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

iOS Simulator preview build is ready: https://github.com/stellar/freighter-mobile/releases/tag/untagged-7fe2159ba067dec077f7 (SDF collaborators only — install instructions in the release description)

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.

1 participant