Skip to content

Comments

feat: add card reading progress bottom sheet#243

Merged
codebutler merged 4 commits intomasterfrom
feat/reading-progress-bottom-sheet
Feb 22, 2026
Merged

feat: add card reading progress bottom sheet#243
codebutler merged 4 commits intomasterfrom
feat/reading-progress-bottom-sheet

Conversation

@codebutler
Copy link
Owner

Summary

  • Add ReadingProgress data class and readingProgress StateFlow to CardScanner interface
  • Thread onProgress callbacks through all card readers (Classic, Ultralight, FeliCa, DESFire, CEPAS, Vicinity, ISO7816) and all platform scanners (Android, iOS, Web, Desktop)
  • Add ModalBottomSheet to HomeScreen showing NFC reading status with determinate/indeterminate progress bar
  • On iOS, progress updates the native Core NFC alert message instead of the custom bottom sheet

Test plan

  • Web: tap Scan → bottom sheet opens → place card → progress bar becomes determinate → completes → navigates to card detail
  • Android: tap card → bottom sheet shows briefly during read → navigates to card detail
  • iOS: tap Scan → native Core NFC sheet shows progress in alert message → completes
  • Desktop: scan card → bottom sheet shows reading progress → completes
  • Cancel button dismisses scan session on platforms with active scan
  • All tests pass in CI

🤖 Generated with Claude Code

Claude and others added 4 commits February 22, 2026 13:39
Add a ModalBottomSheet to HomeScreen that shows NFC reading progress
with determinate/indeterminate progress bars. Thread onProgress
callbacks through all card readers (Classic, Ultralight, FeliCa,
DESFire, CEPAS, Vicinity, ISO7816) and platform scanners (Android,
iOS, Web, Desktop). On iOS, progress updates the native Core NFC
alert message instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add null checks for window._fbUsb.device before transferOut/transferIn
  calls to prevent JsException when device is disconnected mid-scan
- Add console logging (println + printStackTrace) for scan errors and
  card processing errors in HomeViewModel so they appear in DevTools

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the packaged desktop app runs without libusb installed,
PN533Device.openAll() throws UnsatisfiedLinkError which was uncaught
and crashed silently (no UI feedback). Now catch it gracefully and
fall back to PC/SC-only scanning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The ClassCastException (UnauthorizedClassicSector → DataClassicSector)
was only shown in the UI error dialog but never printed to console,
making it invisible in DevTools. Add println + printStackTrace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codebutler codebutler merged commit 2181101 into master Feb 22, 2026
13 of 14 checks passed
@codebutler codebutler deleted the feat/reading-progress-bottom-sheet branch February 22, 2026 19:02
codebutler pushed a commit that referenced this pull request Feb 22, 2026
Resolve conflicts between key recovery wiring and card reading progress
bottom sheet feature (#243). Key changes in resolution:
- ClassicCardReader.readCard uses master's (Int, Int) onProgress signature
- Key recovery progress messages use println instead of onProgress
- All scanners wire both key recovery (our branch) and progress (master)
- WebUsbPN533Transport device-disconnection checks use error field

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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