feat(pin): add step progress bar to PIN setup flow#115
Conversation
Adds theme_create_progress_bar(), a slim lv_bar indicator anchored below a page title, and wires it into pin_page.c's build_chrome() so the 4-step first-time PIN setup (choose, confirm, split, show words) shows current progress. Gated on current_mode != PIN_PAGE_UNLOCK so it never appears on unlock or the delay/wipe screen.
Narrow the bar from 60% to 40% width and thin its track to match, so it reads as a subtle indicator rather than competing with the title.
|
Thanks for the PR! The progress bar looks good and the fundamentals check out: step numbering is correct on every screen (including the deferred show-words build), bars don't accumulate across state transitions since 1. The flow can end at step 3 of 4 ( When eFuse provisioning is declined by the user, fails, or 2. Redundant mode gate ( The 3. Step count can silently drift (
4. Minor: NULL-anchor fallback in The 5. Question: change-PIN flow shows "n of 4" across 5 screens In |
|
Thank you😊 for the detailed review @odudex. For 1 & 3 -- I'll compute the total step count dynamically based on eFuse availability instead of hardcoding 4. STATE_SETUP_SHOW_WORDS will either not count as a step, or the total will drop to 3 when that path is skipped. For 2 -- I'll remove the PIN_PAGE_UNLOCK guard so the bar appears correctly in change-PIN mode too. For 4 -- I'll require a non-NULL anchor (since the only caller always passes the title) and add an assertion to make that explicit. For 5-- Yes, intentional , the verify screen in change-PIN mode is a gate, not a setup step. The bar only counts the steps where the user is constructing the new PIN. ✌️🙌🤞🤞✌️ |
|
@odudex , Please check the updated PR |
Drop STATE_SETUP_SHOW_WORDS from the step count since it's only reached when eFuse provisioning is accepted and succeeds, so the bar no longer promises an unreachable 4th step when it's declined or fails. Replace the disconnected #define + switch with an enum so the total is derived from the same switch that assigns steps. Remove the redundant PIN_PAGE_UNLOCK mode guard in build_chrome: every unlock/delay/wipe state already maps to 0, so step > 0 was already doing all the work. Require a non-NULL anchor in theme_create_progress_bar via LV_ASSERT_NULL instead of a silent NULL-tolerant fallback, since the only caller always passes the page title and the fallback's offset landed inside the corner-button band.
719d014 to
be21307
Compare
@odudex ,
Adds theme_create_progress_bar(), a slim lv_bar indicator anchored below a page title, and wires it into pin_page.c's build_chrome() so the 4-step first-time PIN setup (choose, confirm, split, show words) shows current progress. Gated on current_mode != PIN_PAGE_UNLOCK so it never appears on unlock or the delay/wipe screen.