Skip to content

fix: dismiss best-effort toast so it stops covering header - #250

Closed
jvsena42 wants to merge 1 commit into
mainfrom
fix/dismiss-toast-covering-header
Closed

jvsena42 wants to merge 1 commit into
mainfrom
fix/dismiss-toast-covering-header

Conversation

@jvsena42

@jvsena42 jvsena42 commented Sep 18, 2026

Copy link
Copy Markdown
Member

Description

waitForToastBestEffort returns as soon as the toast is seen. Unlike waitForToast (which
drag-dismisses by default on Android), it left the toast on screen, and a Bitkit toast overlays the
header for its full ~8s lifetime — including HeaderMenu.

So every caller that follows a toast with openSettings() taps into the toast instead of the drawer
button, and DrawerSettings times out after 30s.

This was failing the settings shard deterministically (3/3 attempts) on 8 open bitkit-android PRs:
@settings_01 - Can switch local currency and @settings_06 - Can swipe to hide balance, both of
which touch TotalBalance (raising a toast) and then open Settings.

Frames from the failure video on bitkit-android#1291, one second apart — the "Switched to USD" toast
covers the hamburger exactly while the tap happens, and the hamburger only reappears after it fades:

t+2s — toast up, no hamburger t+9s — toast gone, hamburger back
toast covering header header visible after toast
the HeaderMenu tap lands here too late, DrawerSettings already timed out

Changes

  • waitForToastBestEffort now clears the toast before returning, instead of only observing it.
  • Android drag-dismisses it, mirroring what waitForToast already does.
  • iOS keeps the existing wait-to-disappear path (drag-dismiss hits the wrong coordinates there,
    since iOS toasts render in a separate window) — no iOS behaviour change.
  • The Android branch re-checks isDisplayed() before dragging: dragOnElement waits on the element
    with the global 30s CI timeout, which would otherwise be spent in full on a toast that already
    faded.
  • Return value is unchanged: true if the toast was observed, false otherwise, never throws.

QA Notes

  • tsc --noEmit and eslint test/helpers/actions.ts pass.
  • prettier --check test/helpers/actions.ts fails on main unmodified too, so it is pre-existing and
    untouched here.
  • Verified against the failing runs rather than re-derived: only the two settings tests that raise a
    toast before opening the drawer fail, and every other shard in the same run passes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jvsena42 jvsena42 self-assigned this Sep 18, 2026
@jvsena42

Copy link
Copy Markdown
Member Author

Superseded: this exact commit (9a5dab0) landed in main via #236, the companion for bitkit-android#1291, which merged alongside it. Closing rather than merging an empty diff — the fix and its rationale are in the commit.

@jvsena42 jvsena42 closed this Sep 18, 2026
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