Let users choose the mobile bottom bar's entries #6026
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #6026"
general
weight: 0.35
gariasf
Part of #6022
Stacked on #6025 (the bar scrolls). Review that PR first; this one adds a single commit on top of it.
Fork pre-flight: jaysbeekay/sure#1047 (same branch, same commit)
Problem
On a phone the bottom bar shows every main nav entry. With PR 1 it scrolls once they don't fit, but a user who never opens Bills or Reports still can't free the room for the entries they do use.
Behaviour
users.preferences["bottom_bar_hidden"].User#update_bottom_bar(hidden:, shown:)writes it underwith_locked_preferences, keeps only known entry keys, and never hideshome. When nothing is hidden, the key is removed.key:(home,transactions,bills,reports,plan,portfolio,assistant). Plan and the pre-preview Budgets entry shareplan. The list moves from the layout toApplicationHelper#main_nav_items, so the settings page offers exactly the entries the layout renders.0, then1from its checkbox when ticked. Disabled Home posts nothing. The appearance update saves the bar after its own locked block, which would otherwise write its copy of the preferences over it.settings_section. No new CSS, and no new JavaScript (it uses the existingauto-submit-form).Not in this PR: reordering entries, and applying the choice to the desktop sidebar. Both are left out of v1 in the issue.
Validation
test/models/user_test.rb, 7 new tests: empty by default; unknown keys dropped;homeignored; shown and hidden applied while unoffered entries keep their state; the key cleared when nothing is hidden;section_order,collapsed_sectionsandpreview_features_enabledunchanged by an update; a preference saved by another request after this user was loaded survives the update.test/controllers/settings/appearances_controller_test.rb, 8 new tests:- The section offers a checkbox per visible entry, Assistant included. Home is checked, disabled and has no hidden field. Bills and Portfolio are absent without preview.
- The section is not offered in intro mode.
- Saving hides the unchecked entries.
- Saving with every entry checked clears the preference.
- Everything unchecked except Home, plus a forged
home=0, leaves Home alone on the bar.- A form without the bar fields leaves the hidden entries alone.
- A hidden entry leaves the bottom bar but stays in the sidebar. The sidebar links are read only from the desktop nav (
data-testid="desktop-nav"), so another list on the page linking the same pages cannot satisfy the check.- An entry that is unavailable anyway (Bills with recurring off; Portfolio without preview) stays off the bar whatever the preference says.
test/views/layouts/shared/nav_item_view_test.rb: the partial acceptskey:and renders the same markup.undefined method 'update_bottom_bar', the partial test onunknown local: :key. With the model in place but no layout filter, the layout test failed onExpected ["/", "/transactions", "/bills", "/reports", "/plan", "/portfolio", "/chats"] to not include "/reports".- Filter applied to the desktop list too:
Expected ["/", "/transactions", "/plan", "/portfolio"] to include "/reports".- Home guard dropped:
Expected: ["bills"] Actual: ["home", "bills"], and the Home-alone controller test.- Unknown-key filter dropped: the unknown-keys model test.
-
with_locked_preferencesreplaced by a plainupdate!from the loaded copy: the concurrent-request test (Expected false to be truthy).bin/rails teston dac108517: 19562 runs, 1 failure, 8 errors. The failure is the known flaky lock-wait check inaccount_statement_import_concurrency_test.rb, which passed when rerun; the 8 errors areReleaseNotesWorkflowTest, from the local test environment, the same as on PR 1.Screenshots
Preview user with the assistant enabled. In "After", Bills and Reports are hidden. "Before" is PR 1 with no setting.
| | Before | After |
|---|---|---|
| Settings > Appearance, 390 px | !before appearance 390 | !after appearance 390 |
| Settings > Appearance, 1440 px | !before appearance 1440 | !after appearance 1440 |
| Bottom bar, 390 px | !before bar 390 (seven entries, scrolls) | !after bar 390 (five entries, no scrolling) |
| Desktop sidebar, 1440 px | !before sidebar 1440 | !after sidebar 1440 (unchanged, Bills and Reports still there) |
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Lets users choose which entries the mobile bottom bar shows. Settings > Appearance now has a Bottom bar section with a checkbox per entry the user can currently see; the bar previously showed every main nav entry and scrolled when they didn't fit.
users.preferences["bottom_bar_hidden"]byUser#update_bottom_barunderwith_locked_preferences, which drops unknown keys, never hideshome, and clears the key when nothing is hidden.ApplicationHelper#main_nav_itemswith a stablekey:per entry; the layout drops hidden keys from the phone list only. Intro mode's two-entry bar has no keys and is never filtered, so the section isn't shown there.User::BOTTOM_BAR_KEYS, and a form without the bar fields leaves the preference alone.<sup>Written for commit 1f22487405297ecd58d0c0adf4b649680173989d. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/we-promise/sure/pull/6026?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/we-promise/sure/6026?returnTo=https%3A%2F%2Fgithub.com%2Fwe-promise%2Fsure%2Fpull%2F6026&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added settings to choose which pages appear in the mobile bottom bar. Home stays visible, and these choices do not affect desktop navigation.
Added Assistant to mobile navigation when available. Pages available only in preview appear in the bottom-bar settings only when accessible.
Bug Fixes
Preserved existing bottom-bar preferences when saving settings without bottom-bar fields.
Ensured unavailable pages remain off the bottom bar and Home cannot be hidden.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->