[WOOMOB-3178] Fix stale store-name subtitle on the toolbar when opening a review from a notification#16264
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a toolbar state leak in the store-management app’s shared collapsing toolbar when navigating directly to Review detail from a push notification, where DashboardFragment could still update the toolbar subtitle while sitting in the back stack.
Changes:
- Restrict
DashboardFragment’s reactivestoreNamesubtitle updates to only when the fragment is actually resumed/visible, preventing subtitle “bleed” onto other screens reached via global navigation. - Add a release note entry documenting the notification→review toolbar subtitle fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/dashboard/DashboardFragment.kt |
Guards the store-name subtitle update with isResumed so the dashboard can’t mutate the shared toolbar while not visible. |
RELEASE-NOTES.txt |
Adds a changelog entry for the stale store-name subtitle appearing on review-from-notification navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Review readiness: Not ready — testing instructions are missing or inadequate. The description explains the what/why but gives no reproducible steps to trigger a review push notification and observe the toolbar subtitle before vs. after the fix. Will review once added.
AI Code Review - No blocking code issues found; see the Review readiness note above.
The fix is correct and well-scoped: guarding the reactive storeName subtitle update with isResumed prevents the back-stacked DashboardFragment from mutating the shared toolbar while another screen (a review opened from a notification) is on top. I confirmed the restore path — BaseFragment.onResume() calls updateActivitySubtitle(), which invokes setSubtitle(getFragmentSubtitle()), and DashboardFragment.getFragmentSubtitle() returns dashboardViewModel.storeName.value, so the subtitle is correctly re-applied on return to the dashboard. The inline comment accurately documents the intent.
Copilot reviewed the PR and generated no comments; I found nothing to add or refute.
PR housekeeping
- Testing: this is a bug-fix PR with no reproduction/testing steps. Please add: preconditions to reach a review push notification (how to generate a product review and receive its notification, or how to simulate it), the exact action (tap the notification to open Review detail directly), and the observable validation (the toolbar subtitle should show the review context / no store name, not the store name) — with a note on what the unpatched build showed.
Automatic review · claude-opus-4-8 · Workflow run
How to reply to a finding
Reply on this review (or inline at the line the finding refers to) with one of:
@claude addressed- I made the change. Bot verifies against the next diff before marking resolved.@claude rejected: <reason>- Will not fix; reason gets quoted on the next review.@claude not-applicable- Finding does not apply (wrong file, already covered elsewhere, etc.).
The bot honours these on the next review pass.
|
|
hichamboushaba
left a comment
There was a problem hiding this comment.
Looks good, great find.
b783531 to
1da2cf5
Compare
1da2cf5 to
d3a9bf8
Compare

Fixes WOOMOB-3178
Description
When a product-review push notification is tapped, the app opens the Review detail screen and its shared collapsing toolbar shows a "weird navbar": the store name appears as a clipped subtitle under the pinned "Review" title, and the app bar looks half-expanded. It only happens on the notification entry path — opening the same review normally (More menu → Reviews → detail) looks fine.
Root cause: the main app uses a single shared collapsing toolbar owned by
MainActivity; fragments describe the state they want andMainActivityapplies it.DashboardFragmentis a special case — it drives the toolbar subtitle (the store name) reactively from astoreNameLiveData observer bound toviewLifecycleOwner.Opening a review from a notification navigates straight to the review detail via a global action, from whatever top-level tab is showing (the dashboard on cold start). Once the review detail is pushed on top, the dashboard's view lifecycle stays
STARTEDin the back stack, so its observer is still active. AstoreNameemission then callsMainActivity.setSubtitle(storeName)and paints the store name onto the review screen's toolbar (which also expands the app-bar area, since a subtitle grows the expanded title space). The review detail had already cleared the subtitle on resume, so this later emission is what leaks through.Fix: only let the dashboard write the shared subtitle while it is actually the visible (resumed) screen. When the dashboard returns to the front,
BaseFragment.onResume()restores the subtitle viagetFragmentSubtitle()(which already returnsstoreName.value), so the normal case is unchanged.The stale subtitle was confirmed via the layout inspector on the review screen (
toolbar_subtitle= the store name) while the review detail was on top.Test Steps
Images/gif
Screen_recording_20260715_145158.mp4
Screen_recording_20260715_144746.mp4
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.