Skip to content

fix navigation - #869

Merged
bordalix merged 3 commits into
masterfrom
fix_navigation
Aug 3, 2026
Merged

bordalix merged 3 commits into
masterfrom
fix_navigation

Conversation

@bordalix

@bordalix bordalix commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

For some reason clanker added a second page for settings (WalletSettings) and kept the old one (Settings) active.
Than he was trying to juggle between them, making a mess.

I removed WalletSettings and now navigation works as expected:

  • If you click the Nudge you go straight to define password (the correct and expected behaviour) instead of settings
  • No more mambo jambo on Settings back button, now it always returns to Home (Settings is no longer a tab)

Navigation works with Back and Forward in the browser, as expected.

Replaces #866

@tiero please review

Summary by CodeRabbit

  • Navigation
    • Settings is now accessed through a single Settings page.
    • Removed the separate Wallet Settings destination.
    • Updated back navigation to return to Wallet from Settings.
    • Improved navigation flows for asset removal, minting, and enabling Arkade Mint.
  • Tests
    • Updated navigation coverage to reflect the consolidated Settings experience.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change removes Pages.WalletSettings and consolidates settings navigation under Pages.Settings. Settings back handling now targets Pages.Wallet, and asset flows use the updated navigation stack.

Changes

Settings navigation consolidation

Layer / File(s) Summary
Settings navigation contract
src/providers/navigation.tsx, src/screens/Settings/*, src/screens/Wallet/HomeHeader.tsx, src/test/App.test.tsx
Removes Pages.WalletSettings, updates root-page and back-navigation handling, routes the wallet settings action to Pages.Settings, and removes the obsolete navbar test.
Asset flow navigation
src/screens/Apps/Assets/*
Updates asset removal, mint success, and mint enable flows to use Pages.Settings without Pages.WalletSettings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • arkade-os/wallet#627: This PR reverses the WalletSettings navigation model in the same navigation, settings, and asset entry points.

Suggested reviewers: sahilc0, pietro909

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title relates to the navigation changes but is too generic to identify the primary fix. Use a specific title such as "Remove duplicate WalletSettings navigation" to identify the main change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_navigation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@arkana-ai-bot arkana-ai-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Navigation cleanup: WalletSettings removal

Pure UI/navigation change — no VTXO handling, signing, forfeit, round lifecycle, or unilateral exit code is touched. No protocol-critical concerns.

Correctness

The core simplification is sound. WalletSettings was a second Pages enum entry pointing to the same <Settings/> component, used as a workaround to let the gear button push Settings as a "forward" page while Settings itself remained a root/tab in ROOT_PAGES. Removing WalletSettings and also removing Pages.Settings from ROOT_PAGES unifies both paths cleanly.

Trace through the new flow is correct:

  • Home gear → navigate(Pages.Settings) → forward push (backStack: [Pages.Wallet])
  • Browser back from Settings menu → popstate → backStack pop → Pages.Wallet ✓
  • Settings back button → navigate(Pages.Wallet) → root navigation, clears backStack ✓
  • subNavHandler delegation in handlePopState still checks Pages.Settings ✓

replace() calls in Detail.tsx, MintSuccess.tsx, and Assets/Settings.tsx correctly simplify from [Pages.Settings, Pages.WalletSettings] to [Pages.Settings] since only one entry can ever exist in the backStack now.

No remaining WalletSettings references in the codebase — grep confirms the diff covers all nine sites.

Issues

App.test.tsx:214-224 — duplicate test after the rename

The test named "hides navbar on wallet-launched settings when authenticated and initialized" is changed from Pages.WalletSettings to Pages.Settings. After this PR, it has identical inputs to the test immediately above it at lines 202-212 ("hides navbar on settings menu when authenticated and initialized"). Both pass screen: Pages.Settings, option: SettingsOptions.Menu. One of these should be removed, or the surviving test name updated to remove the now-meaningless "wallet-launched" distinction.

Settings/Menu.tsx:22 — hardcoded back target

<Header text='Settings' backFunc={() => navigate(Pages.Wallet)} />

navigate(Pages.Wallet) is a root navigation that clears the entire backStack. This works correctly while Settings is only reachable from HomeHeader. If any future path navigates to Pages.Settings from a non-Wallet screen (e.g., a post-init flow), the back button will skip over the intermediate page and go straight to Wallet. Not a current bug, but worth a comment noting the assumption, or using goBack() for resilience.

Pages enum ordinal shift (navigation.tsx)

Removing WalletSettings (previously between Vtxos/Wallet and WalletSwap by alpha order) renumbers WalletSwap. Since these values are only held in-memory (not serialized to storage or sent over the wire), this is safe.

No cross-repo impact

The Pages enum is internal to the wallet app; grepping the SDK clones (ts-sdk, go-sdk, rust-sdk, dotnet-sdk) finds no consumers.


Two nits (duplicate test, hardcoded back comment), but neither blocks the fix. The navigation logic is correct.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: de2d64d
Status: ✅  Deploy successful!
Preview URL: https://c304cba9.arkade-wallet.pages.dev
Branch Preview URL: https://fix-navigation.arkade-wallet.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: de2d64d
Status: ✅  Deploy successful!
Preview URL: https://ff3af193.wallet-bitcoin.pages.dev
Branch Preview URL: https://fix-navigation.wallet-bitcoin.pages.dev

View logs

@arkana-ai-bot arkana-ai-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up pass on 41b5867 — 1 commit since f0cfcea; 1 prior issue fixed, 1 still open.


Prior issue closeout

[1] Duplicate test — Fixed (commit 41b5867 "remove duplicated test")

The test "hides navbar on wallet-launched settings when authenticated and initialized" (src/test/App.test.tsx:214-224 in f0cfcea) has been removed. It had screen: Pages.Settings, option: SettingsOptions.Menu — identical inputs to the surviving test at lines 202-212 ("hides navbar on settings menu when authenticated and initialized"). Correct removal; the remaining test provides full coverage of this case.

[2] Hardcoded back target — Still open (src/screens/Settings/Menu.tsx:22, unchanged)

<Header text='Settings' backFunc={() => navigate(Pages.Wallet)} />

Not touched by the new commit. Still a nit: if Settings is ever reachable from a non-Wallet screen the back button will skip over the intermediate page. Not a current bug given the single entry-point, but the assumption is silent. No change since last pass.


Incremental diff assessment

The only change in this push is the deletion of the duplicate test. No new code was introduced. No protocol logic, signing, VTXO handling, or navigation logic was modified. No new issues.


Nothing blocking in this pass. The one remaining nit (hardcoded back target) is pre-existing and non-blocking.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/providers/navigation.tsx`:
- Line 88: Update the navigation history handling around ROOT_PAGES and
handlePopState to distinguish browser Back from Forward, using history.state or
a forward stack so Wallet → Settings → Back → Forward restores Settings when
backStack is empty. Add a regression test covering this complete navigation
sequence.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c50a3443-b409-490f-b928-3cf454350fc1

📥 Commits

Reviewing files that changed from the base of the PR and between b6f5135 and de2d64d.

📒 Files selected for processing (8)
  • src/providers/navigation.tsx
  • src/screens/Apps/Assets/Detail.tsx
  • src/screens/Apps/Assets/MintSuccess.tsx
  • src/screens/Apps/Assets/Settings.tsx
  • src/screens/Settings/Index.tsx
  • src/screens/Settings/Menu.tsx
  • src/screens/Wallet/HomeHeader.tsx
  • src/test/App.test.tsx
💤 Files with no reviewable changes (1)
  • src/test/App.test.tsx


// Root pages - switches between these get no animation
const ROOT_PAGES = new Set([Pages.Wallet, Pages.Settings])
const ROOT_PAGES = new Set([Pages.Wallet])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Add forward-history handling for the non-root Pages.Settings route.

When Pages.Settings is excluded from ROOT_PAGES, navigating from Wallet adds a browser history entry. handlePopState still treats every popstate as Back. After Back returns to Wallet, Forward fires with an empty backStack, so the screen remains Wallet.

Track navigation direction with history.state or a forward stack. Add a regression test for Wallet → Settings → browser Back → browser Forward.

Also applies to: 229-230

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/providers/navigation.tsx` at line 88, Update the navigation history
handling around ROOT_PAGES and handlePopState to distinguish browser Back from
Forward, using history.state or a forward stack so Wallet → Settings → Back →
Forward restores Settings when backStack is empty. Add a regression test
covering this complete navigation sequence.

Source: Coding guidelines

@bordalix
bordalix merged commit 947f2e0 into master Aug 3, 2026
8 checks passed
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.

2 participants