Skip to content

fix(navigation): back-fill newly-added nav bar buttons into persisted order - #1157

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/navbar-backfill-tips-tab
Jul 27, 2026
Merged

fix(navigation): back-fill newly-added nav bar buttons into persisted order#1157
bmc08gt merged 1 commit into
code/cashfrom
fix/navbar-backfill-tips-tab

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

Toggling the Tipping beta flag on two users' devices never surfaced the Tips tab on the scanner — on any restart.

The Tips tab is gated by the persisted nav bar order (FeatureFlag.NavBar option), not the beta flag directly. ScannerNavigationBar builds its buttons by filtering the deserialized NavBarConfig.order — it can only ever remove buttons, never inject them:

config.order.filter { option ->
    when (option) {
        NavBarButton.Tips -> state.isTippingEnabled  // only keeps Tips if already in order
        ...
    }
}

Tips was added to the NavBarButton enum and defaultOrder in #1121, after the drag-to-reorder nav bar settings shipped in #767. Any user who customized their nav bar order in between persisted a string like Discover,Give,Send,Wallet|Cash — no Tips. NavBarConfig.deserialize only fell back to defaultOrder when the parsed list was empty, so it reconstructed the legacy order verbatim, permanently missing Tips. Enabling the tipping flag flipped isTippingEnabled correctly, but there was no Tips in config.order for the filter to keep.

Fresh users and users who never opened the reorder sheet were unaffected (their default option is the current NavBarConfig.Default.serialize(), which includes Tips) — which is why it worked on some devices but not these two.

Fix

NavBarConfig.deserialize now merges any NavBarButton missing from a persisted order, inserting each at its position in defaultOrder. Self-heals affected devices on next launch — no data migration needed.

Tests

Added NavBarConfigTest (6 cases, all passing), including the regression: a legacy Discover,Give,Send,Wallet|Cash string now deserializes with Tips back-filled between Send and Wallet. Also covers custom-order preservation, unknown-name dropping, and empty/blank fallback.

… order

Users who customized their nav bar order before Tips was added to the
NavBarButton enum (#1121) had a persisted order string without Tips.
NavBarConfig.deserialize only fell back to defaultOrder on an empty list,
so it reconstructed the stored order verbatim, missing Tips. The scanner
nav bar filter can only remove buttons, never add them, so enabling the
tipping beta flag never surfaced the Tips tab on those devices.

deserialize now merges any button missing from the persisted order,
inserting each at its position in defaultOrder. Self-heals affected
devices on next launch with no migration.
@github-actions github-actions Bot added the type: fix Bug fix label Jul 27, 2026
@bmc08gt
bmc08gt merged commit 06de01b into code/cash Jul 27, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/navbar-backfill-tips-tab branch July 27, 2026 16:13
@bmc08gt bmc08gt self-assigned this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant