Skip to content

fix(android): preserve More in back navigation - #1571

Merged
ryanbr merged 1 commit into
ryanbr:mainfrom
SpurgtBror:fix/android-more-back-navigation
Aug 24, 2026
Merged

fix(android): preserve More in back navigation#1571
ryanbr merged 1 commit into
ryanbr:mainfrom
SpurgtBror:fix/android-more-back-navigation

Conversation

@SpurgtBror

@SpurgtBror SpurgtBror commented Aug 23, 2026

Copy link
Copy Markdown

What this PR does

Preserves the Android More page in the navigation back stack when one of its 27 destination rows is opened.

More became a real NavHost destination in 798567e1, but its rows continued using navigateTopLevel(). That helper pops to the graph start destination (Today) before navigating, so the stack became Today → destination and Android Back skipped More.

The shared More callback now performs an ordinary push:

before: Today → More; More row → Today → destination
after:  Today → More → destination

Bottom-tab selections keep their existing single-top state save/restore behavior. Contextual top-level links elsewhere are untouched because their section-switching semantics are independent of this report.

A focused source-contract regression test pins both sides of that boundary: every generated More row still uses the shared push callback, while bottom tabs continue through navigateTopLevel().

No BLE, protocol, persistence, analytics, localization, public API, or visual/layout changes.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • CI / tooling

How it was tested

Added MoreNavigationContractTest.moreRowsPushWhileBottomTabsRemainTopLevel, which checks that:

  • the More route uses nav.navigate(it);
  • it cannot regress to nav.navigateTopLevel(it);
  • all generated More rows retain the shared callback;
  • bottom-tab selections retain navigateTopLevel().

Local source checks:

  • python3 Tools/doc_comment_lint.py — pass
  • python3 Tools/i18n_audit.py --ci origin/main — pass
  • git diff --check — pass
  • GitHub Android CI: assembleFullDebug + testFullDebugUnitTest — pass

Android compile/unit-test commands were attempted but could not start because this workspace has no Java runtime or Android SDK:

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

The PR is therefore opened as a draft pending ./gradlew testFullDebugUnitTest, ./gradlew compileFullDebugKotlin, and Android emulator/device verification.

Manual acceptance matrix for that verification:

  • More → one destination from each group → Back returns to More.
  • More → Settings → Test Centre/Backup & Sync → Back returns to Settings, then More.
  • More → Health → vital detail → Back returns to Health, then More.
  • Back from More returns to Today.
  • Bottom-tab state save/restore remains unchanged.
  • Settings opened from the Today avatar still returns to Today.

Checklist

  • Swift package tests pass for any package I touched (swift test in Packages/<name>) — no Swift packages touched
  • Android unit tests pass if I touched android/ (./gradlew testFullDebugUnitTest) — GitHub Android CI
  • No new build warnings introduced — awaiting Android compilation
  • UI changes use only StrandDesign tokens — no visual/layout changes
  • No hardcoded hex frame bytes; protocol facts live in the schema / decoders — no protocol changes
  • Follows the conventions in docs/CONTRIBUTING.md
  • I did not commit generated output (Strand.xcodeproj/) or any secrets/keystores

Related issues

Closes #1570

Related: #397 proposes a larger replacement of the current More page.

@ryanbr
ryanbr marked this pull request as ready for review August 24, 2026 05:51
@ryanbr
ryanbr merged commit 9d19b14 into ryanbr:main Aug 24, 2026
3 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.

Android: Back from More destinations returns to Today instead of More

2 participants