Repository navigation
fix(flashcard): close the BoltCard screen on Remove card instead of showing "No Cards Found" - #756
Merged
Merged
Conversation
…howing "No Cards Found" "Remove card" on the BoltCard screen cleared the card and nothing else, so the screen stayed up and fell through to its empty state — "No Cards Found / Tap a Flashcard to add it here" — which exists for arriving without a card, not for having just removed one. The Cashu card screen already closes on removal; this makes the BoltCard screen do the same. The Flashcard component now takes an onRemove prop, and the screen's handler clears the card then pops, only while focused, so a removal on the way out cannot pop a second screen. Opening the screen without a card still shows the empty state. Field-found on the Pixel 8 Pro during the 0.8.0 Flashcard v1 pass, 2026-10-06; the behaviour is unchanged since 0.7.2. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…the tsc break Review fixes for #756. - The popped screen stays mounted for its exit animation with the card already cleared, so it rendered the "No Cards Found" empty state for the ~300 ms slide — the frame the fix exists to remove. A `removing` flag renders nothing in that window; the empty state stays for arriving without a card. The spec now asserts the empty state is absent after Remove, which it did not before. - `Flashcard`'s new required `onRemove` prop broke `yarn tsc:check`: the two renders in flashcard-tap-call-sites.spec.tsx did not pass it. Jest does not type-check, so the suite still passed. - The focus-guard comment borrowed the Cashu screen's rationale, which does not apply here: the signed-out `beforeRemove` reset never reaches `onRemove`, and the Remove button is hidden while signed out. The comment now says the guard is defensive, and the second test is named for what it pins. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
"Remove card" on the BoltCard (Flashcard v1) screen cleared the card but left the screen up, which then rendered its empty state: "No Cards Found / Tap a Flashcard to add it here". That state is for arriving without a card, not for having just removed one. The Cashu card screen already closes on removal; this makes the v1 screen do the same.
How
Flashcard(the v1 card component) takes anonRemoveprop instead of callingresetFlashcarditself.CardScreen's handler clears the card and pops. The popped screen stays mounted for its exit animation with the card already gone, so aremovingflag renders nothing in that window instead of the empty state.isFocused()check before the pop is defensive, for a press that lands mid-transition. The signed-outbeforeRemovereset never goes through this handler, and the Remove button is hidden while signed out.Tests
__tests__/screens/card-remove.spec.tsx, against the realFlashcardProviderand the real screen:goBackonce, and the empty state is not rendered on the popped screen.The two
<Flashcard>renders inflashcard-tap-call-sites.spec.tsxpass the new prop, soyarn tsc:checkis clean (it was not on the first push). Pre-existing lint warnings incard.tsxand the conditional-hook errors inFlashcard.tsxare untouched; CI lints changed lines only.Field note
Found on the Pixel 8 Pro during the 0.8.0 Flashcard v1 pass on 2026-10-06. Behaviour is unchanged since 0.7.2, so this is a fix, not a regression.
🤖 Generated with Claude Code