UI adjustments & Fixes#119
Merged
Merged
Conversation
Reading the card consumes the click's transient user activation, so showSaveFilePicker cannot be called from the continuation of the device exchange (it throws "Must be handling a user gesture"); opening it before the approval instead would create the chosen file on disk and leave it empty if the device is rejected. Use a two-step flow: back up first, then surface a "Save…" button that opens the native save dialog from its own click. This keeps the file-name dialog without the SecurityError and without creating an empty file on rejection; falls back to an anchor download where the File System Access API is missing.
The "Storage 4096 bytes" line showed the total metadata capacity read from GET_APP_CONFIG. It is a constant, so it adds noise to the device card.The controller still reads storage_size internally for buffer sizing;only the UI row and its React state are removed.
override_metadatas() took the destination offset as a uint8_t, but load_metadatas() passes app_state.bytes_transferred (size_t, up to MAX_METADATAS = 4096).Small backups happened to work because only the first chunk carries data;larger lists (> ~255 bytes of metadata) were corrupted.
Cover the boundary behaviour of the metadata store: - override_metadatas at offset 300 lands at 300, not at 300 % 256 == 44 (regression guard for the uint8_t-offset truncation fix), plus a write at the very end of the buffer. - write_metadata refuses new entries once full (ERR_NO_MORE_SPACE_AVAILABLE), so the 4096-byte buffer cannot overflow.
The RUN_TEST dispatch was already guarded by #ifdef TESTING, but tests.c was compiled unconditionally (APP_SOURCE_PATH globs all of src/) and dispatcher.c included tests.h unconditionally. Guard the test handler's definitions and the include with #ifdef TESTING so production builds (TESTING=0) contain no test code at all, instead of relying on linker dead-code elimination. The #include lines in tests.c stay outside the guard to avoid an empty translation unit.
Replace the device prompts "Transfer metadatas ?" / "Overwrite metadatas ?" with "Backup" / "Restore" + "password list", aligned with the WebUI buttons, and without the stray space before "?". Wallet screens keep the question mark; the Nano variant drops it. The WebUI notices, FAQ and README that quote these prompts are updated to match.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #119 +/- ##
===========================================
+ Coverage 73.96% 81.88% +7.92%
===========================================
Files 7 7
Lines 361 381 +20
Branches 41 42 +1
===========================================
+ Hits 267 312 +45
+ Misses 88 53 -35
- Partials 6 16 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Also silence pylint's false no-member errors on the MetaScreen-generated CustomTouchScreen members (surfaced now that the file is touched).
cedelavergne-ledger
force-pushed
the
cev/UI_adjustments
branch
from
June 19, 2026 12:00
0d28d32 to
897a222
Compare
On touch devices the passwords list is paginated and NBGL forwards a page-relative index, so password_callback() rebuilds the absolute index from the page number. Add a regression test that seeds enough passwords to span two pages, shows the first entry of page 2, and asserts the revealed value matches the value derived independently for that nickname (guarding against an off-by-page error in the recalculation). Marked skip_nano since the Nano list shows one choice per page.
cedelavergne-ledger
force-pushed
the
cev/UI_adjustments
branch
from
June 19, 2026 14:01
897a222 to
81128a6
Compare
Contributor
tdejoigny-ledger
approved these changes
Jun 19, 2026
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.
Description
Changes include
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it.
Additional comments
Please post additional comments in this section if you have them, otherwise delete it.