Skip to content

Filter history: product list integration - #16423

Open
AdamGrzybkowski wants to merge 1 commit into
issue/WOOMOB-3826-order-list-integrationfrom
issue/WOOMOB-3827-product-list-integration
Open

Filter history: product list integration#16423
AdamGrzybkowski wants to merge 1 commit into
issue/WOOMOB-3826-order-list-integrationfrom
issue/WOOMOB-3827-product-list-integration

Conversation

@AdamGrzybkowski

Copy link
Copy Markdown
Contributor

Part of WOOMOB-3326WOOMOB-3827

Description

Final PR in the filter history stack: wires the shared history screen into the product list filters (reusing the clock entry point from #16422). Behind the FILTER_HISTORY flag.

  • Flag-gated clock entry point on the product filter screen → history with source=products and filter_history_button_tapped.
  • Saves the current selection on Show Products via SaveProductFilterToHistory (app-scope, fire-and-forget, runCatching). Products use a single shared ViewModel, so the save is covered whether Show Products is tapped from the list or an options sub-screen.
  • Applies a picked past filter by repopulating the in-memory productFilterOptions map + category name, then reloading the filters.
  • ProductFilterHistoryMapper is a pure JSON codec (matching the order side); label resolution lives in the use case. The category name is only persisted when a category id is actually selected, so clearing to "Any" can't leak a stale name or break dedup.

Test Steps

Enable Filter History in the developer feature-flag screen, then on the Products tab:

  • Open Filters → tap the clock → confirm empty history.
  • Select filters → Show Products → reopen history → filter appears at top; confirm newest-first + dedup; swipe to delete; apply a past filter and confirm it repopulates and Show Products lists correctly; Clear History → confirm → empty state.
  • Verify Tracks events fire with source=products.

Stacked PRs

PR 4 of 4. Base branch: issue/WOOMOB-3826-order-list-integration (#16422).

  • I have considered if this change warrants release notes — none needed (behind feature flag, not user-facing).

@wpmobilebot

wpmobilebot commented Aug 14, 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 Number778
Version25.4-rc-1
Application IDcom.woocommerce.android.prealpha
Commitc57d377
Installation URL6h1jckpu7vtjg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@AdamGrzybkowski AdamGrzybkowski added this to the 25.5 milestone Aug 14, 2026
@AdamGrzybkowski AdamGrzybkowski added status: feature-flagged Behind a feature flag. Milestone is not strongly held. New Feature labels Aug 14, 2026
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3827-product-list-integration branch from a1ca77f to f82a1c1 Compare August 14, 2026 14:49

@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.

AI Code Review - No issues found. The changes look good.

This PR integrates filter history into the product list, closely mirroring the existing order-list use case. I verified the following and found the change correct and safe:

  • The referenced nav action (action_productFilterListFragment_to_filterHistoryFragment), R.menu.menu_filter_history, and the analytics constants (FILTER_HISTORY_BUTTON_TAPPED, VALUE_FILTER_HISTORY_SOURCE_PRODUCTS) all already exist in the codebase, so the new code compiles and wires up correctly.
  • ProductFilterHistoryMapper is a pure codec: fromPayload swallows malformed JSON via runCatching and returns null, and the category-name is only persisted when a category id is present, keeping dedup by payload reliable.
  • SaveProductFilterToHistory is a fire-and-forget best-effort write on the app scope, guarded by the feature flag and a hasSelection() check, with failures logged rather than propagated.
  • onPastFilterSelected rebuilds the in-memory options and savedState consistently before loadFilters(), and the feature flag also gates menu visibility.
  • Test coverage is thorough: round-trip/dedup for the mapper, save/skip/label-resolution for the use case, and repopulation + undecodable-payload handling for the ViewModel.

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.

@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3827-product-list-integration branch from f82a1c1 to 8b65f8e Compare August 14, 2026 15:04
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3827-product-list-integration branch from 8b65f8e to 60a111a Compare August 14, 2026 15:07
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3827-product-list-integration branch from 60a111a to 7c973a6 Compare August 14, 2026 15:14
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3827-product-list-integration branch 2 times, most recently from f5a595b to 2bb1d60 Compare August 14, 2026 15:22
Adds a flag-gated clock entry point on the product filter screen, saves the current selection to history on Show Products (via SaveProductFilterToHistory on the app scope), and applies a picked past filter. Part 4 of WOOMOB-3326 (WOOMOB-3827).
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3827-product-list-integration branch from 2bb1d60 to c57d377 Compare August 14, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Feature status: feature-flagged Behind a feature flag. Milestone is not strongly held.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants