fix(client): back navigation follows history, not always the landing screen #374
No reviewers
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol!374
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-drawer-back-history"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug: back always returned to Chat regardless of where you came from.
Root cause: the
(app)Drawer leftbackBehaviorat its default. The vendored drawer/tab router defaults tobackBehavior: "firstRoute"(confirmed inBaseTabRouter({ …, backBehavior = 'firstRoute' })), which sends every back action — Android hardware back, browser back, and the in-app back buttons viarouter.back()— to the first/landing route, ignoring history. After the default landing moved to Chat (#373), that surfaced as "back always goes to Chat."Fix: set the Drawer's
backBehavior="history"so back pops to the actual previous screen. One line inapp/(app)/_layout.tsx.This makes the network detail screens' existing
goBackOr(router, "/network")behave correctly —router.back()now returns to the prior screen when there's history, and still falls back to the logical parent (/network) on a cold start / deep link (so you also get "up categorically" for free in the no-history case).Verification (local)
typecheck✓ (confirmsbackBehavioris a valid<Drawer>prop) ·lint✓ ·test✓ 172 · semgrep ✓ 0 findings⚠️ Needs maintainer verification
Navigation behavior isn't covered by the
node-env tests — please confirm on device/web: from a person/org detail → back returns to Network (not Chat); from Network → back returns to the previous tab; and a cold-start/deep-link straight onto a detail screen still lands "up" on Network.Direct bug report (no ticket).
🤖 Generated with Claude Code
The (app) Drawer left backBehavior at its default ("firstRoute"), so every back action — system back, browser back, and the in-app back buttons via router.back() — jumped to the first/landing route regardless of where you came from. After the default landing moved to Chat (#373) that meant back always went to Chat. Set the Drawer's backBehavior to "history" so back pops to the actual previous screen. The network detail screens' goBackOr(router, "/network") now genuinely returns to the prior screen when there's history, and still falls back to the logical parent on a cold start / deep link. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>📊 Test coverage
Patch coverage: no testable lines changed.
Overall (
app/,lib/,db/, excluding UI per ADR-0019):Soft thresholds per ADR-0019. Coverage is informational and does not block merge.