User-configurable bottom navigation + NomadNet browsing polish - #1124
Conversation
Let users choose which shortcuts appear in the bottom bar and in what order, up to NavTab.MAX_TABS (5) entries. Settings is pinned last and cannot be removed; the last editable shortcut cannot be removed either. - NavTab registry with sanitize() as the single normalization authority: unknown ids dropped, dedupe, pinned Settings appended, cap enforced, fallback to the default layout so a corrupt pref can never render an empty bar - BottomNavigation settings card: add chips, remove, up/down reorder - Tab selection is now route-prefix based; the index-based selectedTab state and its route-sync effect are gone - The NomadNet tab keeps the bottom bar visible while browsing pages (previously the browser hid it). The tab opens the last-browsed node via the new nomadnet_home destination, with an address-entry prompt on a fresh install. Page content pads 88.dp to clear the bar. - Layout persists in DataStore (bottom_nav_tabs CSV); the browser records nomadnet_last_node on every successful page load
…ar edit Two device-found bugs in the configurable bottom bar: - loadSettings()'s combine rebuilds SettingsState from scratch and re-passes every collector-owned field. bottomNavTabs and nomadNetLastNodeHash were missing from that preserve list, so every settings emission reset them to defaults; distinctUntilChanged meant the collector never re-emitted, leaving the bar stuck on defaults after a restart despite the DataStore value being correct. - The address-bar BasicTextField's onFocusChanged handler re-fired the initial unfocused state when it composed, immediately cancelling the edit mode the 'Enter address' home prompt just enabled. Switched to onFocusEvent, which only fires on real focus transitions.
The home prompt toggled the top-bar isEditingUrl to reveal the address bar, but that shared focus/edit state raced with the field's focus handler and the editor flashed away after a single frame. The home page now renders its own always-present, auto-focused address field with a Go button (Chrome new-tab omnibox pattern) that submits directly via navigateToUrl - no shared edit-state to clobber.
… on tab switch - Close Site now clears the persisted nomadnet_last_node binding and resets browser state, so the bottom-nav tab reopens at the address prompt instead of the closed site - Tab home keeps its position (swaps to the prompt in place); the standalone browser pops like Back - Tapping a different tab while browsing collapses the nomadnet stack first, preventing duplicate browser views
…keyboard - The empty NomadNet tab no longer steals focus, so opening the tab does not pop the soft keyboard - The entry block is biased to the upper third and pads for the IME, so the address field and Go button stay clear when the keyboard opens
announce_detail was in the hide-the-bar prefix list, which made the bar vanish on Node Details and pop back on return - jarring next to the new always-visible browsing flow.
The scroll column ended at 16.dp, so the last card sat behind the nav bar now that the bar is visible on this screen. Use the same 88.dp bottom clearance as the other nav-visible screens.
Greptile SummaryThe PR adds a persisted, sanitized, user-configurable bottom navigation bar and integrates NomadNet as a normal top-level tab while polishing its browsing, empty-entry, and Close Site behavior.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User taps NomadNet tab] --> B{Saved node exists?}
B -->|No| C[Show address-entry prompt]
B -->|Yes| D[Load saved node]
C -->|Submit address| E[Browse NomadNet page]
D --> E
E --> F[Persist active node]
E -->|Close Site| G[Set browser state to Initial]
G --> H[Clear persisted node]
H --> C
E -->|Tap another tab| I[Collapse NomadNet stack]
I --> J[Navigate to selected tab]
Reviews (3): Last reviewed commit: "fix(nomadnet): evaluate the last-node sa..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- emitPageLoaded only persists the node hash while the view still shows that page, so a page that landed just before Close Site can no longer re-save the binding behind closeSite's clear (greptile P1) - Bottom Navigation card copy now describes the arrow controls instead of drag-to-reorder, which the UI does not implement (greptile P2)
|
Both greptile findings addressed in 3805272:
|
… transaction Closes the remaining check-then-write window greptile flagged: the PageLoaded predicate now runs under the DataStore edit mutex, so a save either loses to Close Site's clear (predicate false, nothing written) or commits before it and is properly erased. No interleaving can leave a just-closed site persisted.
|
Follow-up P1 (3928581672) also addressed in the next push: the guard moved inside the DataStore edit transaction via a new |
Summary
Test notes