Skip to content

fix(tablet): use $gtMd breakpoint on native for foldable split-screen#10384

Open
PatrickChoo wants to merge 2 commits intoOneKeyHQ:xfrom
PatrickChoo:fix/android-foldable-wallet-actions
Open

fix(tablet): use $gtMd breakpoint on native for foldable split-screen#10384
PatrickChoo wants to merge 2 commits intoOneKeyHQ:xfrom
PatrickChoo:fix/android-foldable-wallet-actions

Conversation

@PatrickChoo
Copy link
Contributor

@PatrickChoo PatrickChoo commented Feb 27, 2026

Summary

  • On Android foldable devices in split-screen mode, window width can be 640-767px which triggers $gtSm breakpoint, incorrectly showing desktop pill-style buttons instead of mobile card-style buttons
  • Raises the responsive breakpoint from $gtSm (≥640px) to $gtMd (≥768px) on native platforms so only truly wide screens switch to desktop style
  • Also future-proofs for potential iOS foldable devices

Changes

  • RawActions.tsx: ActionItem, ActionMore, and RawActions wrapper use $gtMd on native
  • ActionBuy.tsx (TokenDetails): Same fix for the buy/sell dual-render pattern

Test plan

  • Android foldable split-screen (640-767px): buttons show mobile card style
  • Android normal: buttons show mobile card style
  • iPad: buttons switch to desktop style at ≥768px
  • Web/Desktop: buttons still switch to pill style at ≥640px (unchanged)
Screenshot_2026-02-27-16-28-25-81_20825476e94af76222e0dd58d72aae7f
Open with Devin

…-screen desktop style

On Android foldable devices in split-screen mode, window width can be
640-767px which triggers $gtSm but should still show mobile card style.
Raise the breakpoint to $gtMd (≥768px) on native platforms so only
truly wide screens switch to desktop pill buttons. Also future-proofs
for potential iOS foldable devices.
@revan-zhang
Copy link
Contributor

revan-zhang commented Feb 27, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

🐛 1 issue in files not directly in the diff

🐛 Caller passes $gtSm to RawActions, bypassing the $gtMd fix on native foldable split-screen (packages/kit/src/views/Home/components/WalletActions/index.tsx:288-292)

The WalletActions component in index.tsx:288 still passes $gtSm as a prop to RawActions. Inside RawActions (RawActions.tsx:294-308), the platform-conditional breakpoint ($gtMd on native) is spread first, then {...rest} is spread after at line 309. Since $gtSm and $gtMd are independent Tamagui responsive props, they don't override each other — both are applied. On a native foldable device in split-screen at 640–767px, $gtSm from the caller triggers and applies flexDirection: 'row' and justifyContent: 'flex-start' to the container, while the children (ActionItem, ActionMore) still show mobile card style because they now use $gtMd (which doesn't trigger until ≥768px). This creates a layout mismatch.

Root Cause

At packages/kit/src/views/Home/components/WalletActions/index.tsx:288-292:

$gtSm={{
  flexDirection: 'row',
  justifyContent: 'flex-start',
  gap: '$2.5',
}}

This $gtSm prop flows into RawActions via {...rest} at RawActions.tsx:309, which is spread AFTER the platform-conditional $gtMd at lines 294-308. Because $gtSm and $gtMd are different keys, both survive the spread and are both applied to the XStack. On native at 640-767px width, $gtSm triggers (changing the container to desktop row layout) while child ActionItem components stay in mobile card style (they require $gtMd ≥768px to switch). The container and children are now in conflicting layout modes.

Impact: On Android foldable split-screen (the exact scenario this PR aims to fix), the home page WalletActions container switches to desktop layout at 640px while action buttons remain as mobile cards — the very bug the PR is supposed to prevent.

View 4 additional findings in Devin Review.

Open in Devin Review

The WalletActions component was passing $gtSm directly to RawActions,
which bypasses the $gtMd fix inside RawActions on native. Since $gtSm
and $gtMd are independent keys, both would apply — causing the container
to switch to row layout at 640px while children stay in card style.
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.

3 participants