Repository navigation
feat(flashcard): draw the Bearer card on the Cashu card screen - #755
Merged
Merged
Conversation
Replaces the static flashcard.png with the Flash Card physical design
(Concept A, Bearer) as vector art: app/components/flashcard-v2-art/
cardArtV2.tsx is a byte-for-byte copy of flash-pos's card face, and the
parity spec pins the file's SHA-256, the node digest and the rendered
trees so the two apps cannot drift without a test failing. The card is
drawn in flow (centred, 10 dp above, 16 dp below) instead of the old
PNG's absolute placement, so the balance and the action row sit where
they did on main. In dark mode a 1 dp outline keeps the near-black card
visible on the black page. The accessibility label says the card's
masked id letter by letter ("Flashcard ending 0 C 6 7"); the printed id
derives from the pubkey's last four hex digits as in flash-pos.
FLASH, BEARER CARD and ₿ are outlined Inter glyph paths; the bundled
Sora fonts and those glyphs are credited in THIRD_PARTY_NOTICES.md. The
shared file keeps flash-pos's Prettier style through a self-contained
override. New i18n key FlashcardV2.cardEnding; translations regenerated.
Rebased onto main after #748-#754; the branch's own copy of #748's
action-row move was dropped in favour of main's.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
islandbitcoin
force-pushed
the
jabariennis/flashcard-v2-card-art
branch
from
October 5, 2026 16:15
3500087 to
5983071
Compare
The home screen's Cashu card row used the BoltCard's flag icon. It now shows the Flashcard v2 art (FlashcardV2Art) at the icon's width, without the card screen's drop shadow, and hidden from screen readers: the row's title and amount already say what it is. `Balance` takes an optional `iconNode` to draw in place of its icon; the BoltCard row keeps its icon. Co-Authored-By: Claude Opus 5.5 <[email protected]>
islandbitcoin
pushed a commit
that referenced
this pull request
Oct 9, 2026
Mirror the five new FlashcardV2 keys (slotsSpentNote, topUpSlotsReclaim, topUpReclaimed, topUpSlotsSettling, topUpSettlingNote) and the updated slotSummary into all 23 locale files, the same way #746/#747/#755 did, so check:translation-drift passes. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6
islandbitcoin
added a commit
that referenced
this pull request
Oct 9, 2026
…#759) * feat(cashu-card): CLEAR_SPENT, slot-shape check and spent-slot reads (ENG-631) Add the CLEAR_SPENT (0x31) APDU and `isProofShaped`, the card file's slot checks that tell a CLEAR_SPENT remnant from a proof. A card read now reads every occupied slot (`readCardSlots`) and carries the spent slots on `CashuCardInfo.spentSlots`, so the next top-up can ask the mint about them before its load tap. The Flashcard context re-reads the slots after an op that moved the balance or the spent count, so a clear shows at once. `getUnspentByKeyset` still reads unspent slots only; nothing here sends CLEAR_SPENT. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6 * feat(cashu-card-topup): reclaim mint-settled spent slots on the load tap (ENG-631) `reclaimVerdicts` asks the mint (NUT-07) about the card's proof-shaped spent slots before the tap; `reclaimPlan` says what a reclaim will do with them; `reclaimSpentSlots` re-reads the spent slots in the session and sends CLEAR_SPENT only when every one is a remnant or mint-SPENT, otherwise sends nothing and counts what is still settling. `prepareTopUp` counts `card.reclaimable` as room; `loadTopUp` itself still never clears, and its inventory no longer takes a torn spent slot's nonce as the record's proof. `TopUpError` can carry the reclaim's result with a refusal. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6 * feat(flashcard-v2): free settled spent slots on the top-up's load tap (ENG-631) The load tap now runs VERIFY_PIN, the reclaim, then the load in one session; the mint is asked about the spent slots before the tap, and a mint that cannot answer costs no tap. The amount step counts the slots the tap will free as room (`reclaimable`), the done step says how many were freed, and a no-room refusal says how many spent slots are still settling. The card screen shows unspent, spent and free counts with a note on spent slots. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6 * fix(cashu-card-topup): hand the reclaim's card read to the load, and drop the retry note from the done step (ENG-631) Review fixes on #759. - `reclaimSpentSlots` hands on what it read (`inventory`: the slot statuses and each spent slot's proof) when it sent no CLEAR_SPENT, and `loadTopUp` takes that in place of a read of its own. A first load in the same tap now sends no GET_SLOT_STATUS; a resumed load reads only the unspent slots, taking the spent ones from the reclaim. After a clear the read is stale and the load reads the card afresh, which after a full clear means the unspent slots alone. On a resumed load of a card with k spent and u unspent slots that is u GET_PROOFs before the first LOAD_PROOF instead of 1 + k + u. - The done step's settling note no longer reuses `topUpSlotsSettling`, whose "Try again later." belongs to the `slots` refusal: a load that went through has nothing to try again. New `topUpSettlingNote`. Tests: engine tests count the tap's APDUs for a first and a resumed load with and without a clear, and assert the inventory handed on (or not); the hook test checks the hand-off; the screen test asserts the new note and that it carries no retry imperative. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6 * chore(i18n): add FlashcardV2 reclaim copy to every locale Mirror the five new FlashcardV2 keys (slotsSpentNote, topUpSlotsReclaim, topUpReclaimed, topUpSlotsSettling, topUpSettlingNote) and the updated slotSummary into all 23 locale files, the same way #746/#747/#755 did, so check:translation-drift passes. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6 * fix(flashcard-v2): wait for the reclaim plan before showing the amount field, and rethrow the engine's own refusal (ENG-631) Review fixes on #759: - The amount field waited for the unfinished-top-ups read but not for the reclaim plan. On a card with no empty slot and every slot spent, the room was 0 until the mint answered, so the field refused every amount ("try a smaller amount") and then changed its mind a round-trip later. The screen now tracks the plan settling (`reclaimRead`), set at once when there is nothing to ask about and in a `finally` otherwise, and the field waits on both reads. - `useCardTopUp.load` built a fresh TopUpError to attach the reclaim, so a refused load's stack pointed at the catch block rather than the engine's own check. `TopUpError.reclaim` is now writable and the original error is rethrown with it set. Tests: two screen tests hold the plan (resolve / reject) and assert no field mounts until it settles; a hook test asserts the rejected error is the very one the engine threw. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6 * fix(flashcard-v2): show a spinner while the amount field waits on the reclaim plan (ENG-631) Review fix on #759: - The amount field waits for the reclaim plan, and that plan is a mint round-trip over the phone's network with no timeout. On a card with spent slots the amount step showed the unit caption, "Paid from" and a disabled Continue around a blank gap for as long as the mint took to answer, or RN fetch took to fail. An ActivityIndicator now sits in the field's slot (`topup-amount-loading`) until both the unfinished-top-ups read and the plan have settled, matching the screen's own loading step. - The held-plan, held-read and refused-mint screen tests assert the indicator is present before settle/refuse and gone after. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WxkKbrg2Xohf3mQj7BLrs6 --------- Co-authored-by: Dread <[email protected]> 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
The Cashu card screen (
app/screens/card-screen/flashcard-v2.tsx) now draws the Flash Card physical design, Concept A "Bearer", as vector art instead of the staticflashcard.png: matte near-black base with grain, the gold chip in its dashed orange ring, the contactless marks, the faint brand-bolt watermark, the orange gradient slash with the ₿ on it, and FLASH / BEARER CARD at bottom right. The masked id is derived from the card pubkey's last four hex digits, the same way flash-pos derives it.The home screen's Cashu card row shows the same art as its thumbnail, in place of the BoltCard's flag icon (second commit).
Why
The physical card design is final and the same card should look identical on the card screen here and on the charge screen in flash-pos.
How
app/components/flashcard-v2-art/cardArtV2.tsxis a byte-for-byte copy of flash-pos'ssrc/components/cashu/charge/cardArtV2.tsx(flash-pos 5a4b8b5).__tests__/components/flashcard-v2-art.spec.tsxpins this copy's file bytes, CARD_ART digest and rendered tree to the same constants flash-pos's__tests__/components/cashu/cardArtV2.test.tsxpins, and asserts the SVG structure. Neither spec reads the other repo's file: an edit to either copy fails that repo's suite until its pins are bumped, which is the cue to sync the other. The flash-pos side of this (the byte and render pins in its test) landed in flash-pos as 46d4541. Real cross-repo detection needs a CI step that can read flash-pos (follow-up)..eslintrc.jsonandprettier.config.js, which spells out flash-pos's effective options so none come from this repo's root.grey4outline: its near-black base and black shadow do not show on the black page.THIRD_PARTY_NOTICES.mdcarries the OFL notice for the bundled Sora fonts and credits Inter as a courtesy.FlashcardV2.cardEndingfor the card's accessibility label, read one character at a time ("Flashcard ending 0 C 6 7"); translations regenerated withyarn update-translations.Balancetakes an optionaliconNodethat it draws in place of its icon; the BoltCard row keeps its icon. The Cashu card row drawsFlashcardV2Artat the icon's width (54 dp), without the card screen's drop shadow, inside a view hidden from screen readers, because the row's title and amount already say what it is. On the dark theme the thumbnail also gets the card's 1 dp outline.Testing
yarn tsc:checkclean.npx jest __tests__/screens/flashcard-v2*.spec.tsx __tests__/contexts/flashcard-cashu-card.spec.tsx __tests__/components/flashcard-v2-art.spec.tsx __tests__/components/wallet-overview-cashu-card.spec.tsx: green.yarn check:translations: no generated diffs.no-template-curly-in-stringerrors remain in the generatedapp/i18n/en/index.ts(BankTransfer copy); they are onmainand untouched here.__tests__/components/wallet-overview-cashu-card.spec.tsxpins the thumbnail's width, its missing shadow, and that screen readers skip it. It fails if the row drops the thumbnail, if the thumbnail keeps the shadow, ifBalanceignoresiconNode, or if the hiding is removed (each one tried). With both commits:yarn tsc:checkclean, lint clean on changed lines, full suite 161 suites / 1,896 tests.Notes for review
🤖 Generated with Claude Code