Skip to content

feat(ui): open the gated menu on REVIEW - #161

Merged
PurpleSentinel merged 1 commit into
mainfrom
feature/menu-review-first
Aug 20, 2026
Merged

PurpleSentinel merged 1 commit into
mainfrom
feature/menu-review-first

Conversation

@PurpleSentinel

Copy link
Copy Markdown
Contributor

Closes #160.

before   MODE -> TRACK -> TRIGGER -> SETUP -> REVIEW -> DIAGNOSTICS
after    REVIEW -> MODE -> TRACK -> TRIGGER -> SETUP -> DIAGNOSTICS

Why first position is the one that counts

Opening the menu sets menu_index = 0, so the first item is what a hold lands on with no
swipe at all
. Everything else costs at least one. The order is therefore a statement about
when each item is wanted.

Review was second from last — four swipes from a hold, the furthest thing in the menu from the
gesture that opens it — despite being wanted at the one moment the driver is definitely stopped
and already reaching for the device. Mode, set once and rarely touched again, was free.

The rest keeps its logic: Mode, Track and Trigger are what get decided at the circuit before
going out, in that order, and Diagnostics stays last as the least often wanted.

The trade, stated rather than hidden

Before After
Reach Review hold + 4 swipes + press hold + press
Reach Mode hold + press + … hold + swipe + press + …

Mode gains a gesture, because it is no longer what a hold lands on. Both costs are asserted in
tests, so a later reorder has to face them rather than discover them.

Safe to reorder

MenuItem is never persisted or serialised — menu_item() casts the carousel index straight
to it — so nothing outside the UI depends on the values.

A weakness found while moving them

The enum and kMenuEntries correspond positionally, maintained by hand. The
static_assert added with TRIGGER only checked the count: it would catch a missing entry but
not a swapped pair, which is the easier mistake to make while reordering and the harder one to
notice. Each entry's label is now checked against its enumerator at compile time via a
constexpr string compare, so the two cannot drift apart silently.

A pattern in the test updates

Six tests broke, and every one of them navigated the menu by counting swipes. They were not
testing what they appeared to: a_mode_is_three_gestures_from_the_dashboard pressed once from
the menu and assumed it landed on Mode. Each is now name-based through the to_menu helper, so
inserting or moving a menu item cannot silently point a test at a different one.

Verification

36 host suites, 70 simulator tests, and flashed to the panel: boots clean, no watchdog.

Opening the menu lands on the first item with no swipe at all, and everything else costs
at least one, so the order is a statement about when each item is wanted.

Review was last but one, four swipes from a hold - the furthest thing in the menu from
the gesture that opens it - despite being wanted at the one moment the driver is
definitely stopped and definitely reaching for the device. Mode, which is set once and
rarely touched again, was free. The order now reads Review, Mode, Track, Trigger, Setup,
Diagnostics: Review first, the three things decided at the circuit next in the order they
are decided, and Diagnostics last because it is least often wanted.

The trade is explicit rather than hidden. Review goes from a hold, four swipes and a
press to a hold and a press; Mode gains one gesture, because it is no longer what a hold
lands on. Both costs are asserted in tests so a later reorder has to face them.

MenuItem is never persisted or serialised - menu_item() casts the carousel index straight
to it - so nothing outside the UI depends on the values.

The correspondence between the enum and the carousel array is positional and was
maintained by hand, with a static_assert that only checked the count. It would have
caught a missing entry but not a swapped pair, which is the easier mistake to make while
reordering and the harder one to notice. Each entry's label is now checked against its
enumerator at compile time.

Closes #160

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@PurpleSentinel
PurpleSentinel merged commit 3ec8a33 into main Aug 20, 2026
3 checks passed
@PurpleSentinel
PurpleSentinel deleted the feature/menu-review-first branch August 20, 2026 21:16
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.

Reorder the top-level menu to open on REVIEW

2 participants