Repository navigation
fix: back on the Home screen sends the wallet to the background - #1618
Conversation
Back on Home fell through to LockScreenActivity.handleBackNavigation, which finish()es MainActivity: the tabs live on the nav host's back stack, so the activity's own stack is empty there. Reopening then rebuilt the main screen from scratch. Move the task to the background instead, matching the Android 12+ default for a root activity. When MainActivity isn't the task root (opened inside another app's task), keep finishing, so that app isn't backgrounded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to Back navigation remains within the wallet when a destination can be popped; at the task root, Home back backgrounds the task as intended. No actionable merge-blocking risk is established. Pre-merge checks |
|
|
✅ Final review complete — no blockers (commit 452722c) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The change correctly backgrounds a root MainActivity while preserving finish behavior for non-root launches; no blocking defect was confirmed. The new navigation branch lacks regression coverage, so one non-blocking test suggestion remains. Validation was static only; the supplied exact-head CI snapshot reports successful check and build jobs.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The diff makes a small, contained change to MainActivity.handleBackNavigation(), backgrounding root tasks while preserving the existing lock-screen, back-stack, and non-root behavior. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 86% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 100% left) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `wallet/src/de/schildbach/wallet/ui/main/MainActivity.kt`:
- [SUGGESTION] wallet/src/de/schildbach/wallet/ui/main/MainActivity.kt:474-487: New isTaskRoot/moveTaskToBack back-navigation branch has no test
This branch implements the PR's central behavior, but no test exercises either outcome. A regression could silently restore Home's destructive finish behavior or background another app's task on a non-root launch. Add focused activity tests with the lock screen hidden and the activity fragment back stack empty: assert that the root path requests task backgrounding without finishing, and that the non-root path finishes without requesting task backgrounding. The existing LockScreenActivityCreateGateTest provides a starting point for bypassing Hilt injection, but its early-exit setup does not initialize the unlocked UI needed to reach this branch. Dispatcher-level navigation checks can additionally protect the unchanged handling of sub-screens and tabs.
Extract the decision into homeBackAction() (lock screen → ignore, fragment back stack → pop, Home as task root → move task to back, Home in another app's task → finish) and unit-test each case, so a regression to finish() on Home, or backgrounding another app's task, is caught. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Independently reviewed the complete PR diff at 452722c and traced the surrounding back-navigation, task-launch, and auto-logout behavior; no actionable in-scope issues were found. The extracted decision function and its four branch tests address the prior coverage suggestion while preserving lock-screen interception and fragment-stack handling. This was a static review: the supplied CI snapshot reports check success and build in progress; tests were not run locally, and Android task movement remains unverified on a device.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The diff makes a small, contained change to back-navigation decisions with straightforward branch tests and does not alter a critical surface. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 94% left, weekly 99% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 100% left) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
…sdk-phase-1-v11.9.1 Brings in #1613, #1597 (Kotlin SDK v42int30), #1603, #1612, #1617, #1618 and #1615. - WalletTransactionMetadataProviderGiftCardTest: kept both imports (TransactionRecordsDao from this branch, SdkTxMetadataSource from #1603). - WalletTransactionMetadataProviderSdkStoreTest (new in #1603): passes the transactionRecordsDao this branch added to the provider's constructor. - forgetTransaction() also refuses a transaction the SDK store holds. Since #1603 an SDK-only transaction has real metadata, and the dashj wallet not holding it no longer proves the payment was never sent. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Back on More (or any other bottom-nav tab) left the app: LockScreenActivity's activity-scoped back callback is re-added on every start, so once the activity has been stopped it outranks the nav host's callback and every back press reached MainActivity.handleBackNavigation(), which only looked at the activity's own fragment stack (empty) and sent the wallet to the background (finished it before #1618). handleBackNavigation() now pops the nav back stack while it has a previous entry — a tab goes back to Home, a sub-screen to its parent. On Home, back is consumed: the wallet is neither closed nor backgrounded. Opened inside another app's task (dash: link) it still finishes, so the user is not stranded. Co-authored-by: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
Pressing back on the Home screen closed the wallet by destroying
MainActivity. Reopening it then rebuilt the main screen from scratch, which was slower and lost scroll position and screen state.The cause:
LockScreenActivityregisters a back handler that callshandleBackNavigation().MainActivity's override first triesgoBack(), which pops only the activity's own fragment back stack. The bottom-nav tabs live on the nav host's back stack, so on Home that activity-level stack is empty. The call then falls through tofinish().What was done?
MainActivity.handleBackNavigation()now callsmoveTaskToBack(true). This matches the system default for a root activity since Android 12: the wallet goes to the background and reopens instantly. Auto-logout still applies on resume.MainActivityisn't the task root (for example, it was opened inside another app's task from adash:link), it still finishes as before. Otherwise that other app would be sent to the background.How Has This Been Tested?
:wallet:assemble_testNet3Debugbuilds.Breaking Changes
None.
Checklist:
🤖 Generated with Claude Code
Summary by CodeRabbit