Skip to content

[WOOMOB-3178] Fix stale store-name subtitle on the toolbar when opening a review from a notification#16264

Merged
AdamGrzybkowski merged 1 commit into
trunkfrom
issue/WOOMOB-3178_weird_review_navbar
Jul 17, 2026
Merged

[WOOMOB-3178] Fix stale store-name subtitle on the toolbar when opening a review from a notification#16264
AdamGrzybkowski merged 1 commit into
trunkfrom
issue/WOOMOB-3178_weird_review_navbar

Conversation

@AdamGrzybkowski

@AdamGrzybkowski AdamGrzybkowski commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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 and MainActivity applies it. DashboardFragment is a special case — it drives the toolbar subtitle (the store name) reactively from a storeName LiveData observer bound to viewLifecycleOwner.

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 STARTED in the back stack, so its observer is still active. A storeName emission then calls MainActivity.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 via getFragmentSubtitle() (which already returns storeName.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

  1. Sign in to a store whose name is long enough to be visible (e.g. "Scrumptiously Sure Duck").
  2. Fully close the app (cold start).
  3. Trigger/tap a product review notification so it opens the Review detail screen.
  4. Verify the toolbar shows only "← Review" — no store-name subtitle underneath and no half-expanded app bar.
  5. Back out to the Reviews list and then to My Store; verify the store name still appears correctly as the My Store toolbar subtitle.
  6. Repeat with the app already open in the background (warm start) and confirm the same result.

Images/gif

Before After
Screen_recording_20260715_145158.mp4
Screen_recording_20260715_144746.mp4
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Copilot AI 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.

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 reactive storeName subtitle 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.

@AdamGrzybkowski
AdamGrzybkowski marked this pull request as ready for review July 15, 2026 12:55

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@wpmobilebot

wpmobilebot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

App Icon📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Build Number774
Version25.2-rc-2
Application IDcom.woocommerce.android.prealpha
Commitd3a9bf8
Installation URL3m59he79nik58
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@hichamboushaba hichamboushaba self-assigned this Jul 16, 2026

@hichamboushaba hichamboushaba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, great find.

@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3178_weird_review_navbar branch from b783531 to 1da2cf5 Compare July 16, 2026 19:28
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3178_weird_review_navbar branch from 1da2cf5 to d3a9bf8 Compare July 17, 2026 07:05
@AdamGrzybkowski
AdamGrzybkowski merged commit 563cb10 into trunk Jul 17, 2026
16 checks passed
@AdamGrzybkowski
AdamGrzybkowski deleted the issue/WOOMOB-3178_weird_review_navbar branch July 17, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants