Skip to content

feat(native-overlay): redesign the toast card and add stack gestures (OK-67971) - #350

Open
yikZero wants to merge 3 commits into
OneKeyHQ:mainfrom
yikZero:yikzero/ok-67971-toast-redesign
Open

yikZero wants to merge 3 commits into
OneKeyHQ:mainfrom
yikZero:yikzero/ok-67971-toast-redesign

Conversation

@yikZero

@yikZero yikZero commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

OK-67971


Summary

Brings back the toast redesign reverted in #337 (first commit, a plain revert) and finishes it for OK-67971 (second commit). App side: OneKeyHQ/app-monorepo#14883 (draft until this ships). Spec: native-views/react-native-native-overlay/docs/SPEC.md (toast sections).

Card

  • 16 padding on every side (a one-line card is 52 tall), radius 12 on Web / 16 on iOS and Android, plain 20 status icon.
  • 1 px outer ring plus a soft and a tight contact shadow. iOS now draws the ring outside the card and adds the second shadow; without them the back cards of a collapsed stack read as grey bands.
  • Android centres cards with the 16 padding it actually draws (it still budgeted the old 10).

Actions

  • A single action takes the title row only in room the text leaves empty, measured at layout time on every platform: at most 128 wide, the title still on one line, the message on no more lines. Otherwise it sits in the lower row on the right. The character-count rule is removed.
  • Touch targets 44 (iOS) / 48 (Android) tall. Web buttons keep the default cursor.

Stack gestures (touch on iOS, Android, Web) — includes #335 by @huhuanming, plus fixes for the findings raised on it:

  • Collapsed stack (also a single toast): swipe toward the edge dismisses all (45, or a 20 flick at 500/s); pull away expands. Expanded: push back collapses, sideways dismisses one card.
  • One drag at a time on every platform; a refused gesture stays a press. Toasts shown during a drag enter after it ends, however it ends (release, blur, removal, losing its place).
  • Android: a slot ends its drag before reporting the release, so a release from inside layout cannot re-enter it (the crash in feat(native-overlay): dismiss a collapsed toast stack by swiping toward its edge #335's review); deferred adds are posted; a second finger cancels the drag; vertical drag offsets are reprojected when the pane rescales.
  • Web: a toast re-shown by a dismissed card's callback survives the stack dismissal; cards past the visible three stay hidden during the exit and back cards keep their height; a card closed in code or moved to another lane leaves the drag; a touch collapse clears a parked mouse hover.

Loading

  • A plain icon that replaces a spinner pops in (glyph spring) while the text crossfades.
  • A card shown again under a new generation is announced to VoiceOver / TalkBack, so the App can settle a loading toast in place on native too (companion App PR).

Verification

  • Jest 181/181 (new cases for the Web fixes and one-drag-at-a-time), tsc, eslint, prettier.
  • Chromium browser suite 26/26 (exact style assertions dropped; behaviour checks kept).
  • iOS card sources pass swiftc -typecheck; the App's iOS build was run locally and checked by eye on the simulator before the last round (Android padding, screen-reader announcement, Web drag ownership).

Not verified

  • Android: Kotlin and the unit tests were not compiled in this change.
  • No physical devices; VoiceOver / TalkBack, reduced motion, tablets and foldables not exercised.

yikZero and others added 2 commits November 30, 2026 18:10
…(OK-67971)

Card: 16 padding on every side (a one-line card is 52 tall), radius 12 on
Web and 16 on iOS/Android, a plain 20 status icon, and a 1 px outer ring
with a soft and a tight contact shadow. iOS now draws the ring outside the
card and a second shadow, so the back cards of a collapsed stack keep a
crisp edge. Android centres cards with the same 16 padding it draws.

Actions: a single action takes the title row only in room the text leaves
empty, measured at layout time (at most 128 wide, the title still one line,
the message on no more lines); otherwise it sits in the lower row on the
right. Touch targets are 44 (iOS) / 48 (Android) tall. Web buttons keep the
default cursor.

Gestures (touch on iOS, Android and Web), from OneKeyHQ#335 with its review findings
fixed: a collapsed stack swipes toward its edge to dismiss together (45, or a
20 flick at 500/s) and pulls away to expand; an expanded stack pushes back to
collapse and swipes sideways one card at a time. One drag at a time; toasts
shown during a drag enter after it ends, however it ends. Android ends a
slot's drag before reporting it, so a release from inside layout cannot
re-enter it; a second finger cancels the drag.

Loading: a plain icon that replaces a spinner pops in; a card shown again
under a new generation is announced to screen readers, so a result can
settle in place on native as well.

Co-authored-by: huhuanming <huanming@onekey.so>
@sidmorizon

Copy link
Copy Markdown
Contributor

@codex review

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex security review

@sidmorizon

Copy link
Copy Markdown
Contributor

Cursor review failed.

Remote error: cursor_permission_denied: HTTP 403 Forbidden: Cloud Agent is not available for free users. Please upgrade to Pro.

@cursor

cursor Bot commented Nov 30, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T10:26:17.697317Z 722565b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sidmorizon

Copy link
Copy Markdown
Contributor

Devin Cloud review ↗

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sidmorizon

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 722565bf11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Decide the title-row action from text measured without line clamps on
  Web, iOS and Android, and never put the action of a text-less card there.
- Web: mark a card as loading from the icon it actually shows.
- Android: block keyboard focus in hidden and collapsed back cards; run the
  two text-layout unit tests with native graphics so they measure real text.
- iOS window tests: find the action and link by type rather than subview
  order, and drop the capped inline-action case the redesign removed.

This branch has not been deployed

No deployments
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