Skip to content

Filter history: shared history screen and ViewModel - #16421

Open
AdamGrzybkowski wants to merge 5 commits into
issue/WOOMOB-3824-filter-history-foundationfrom
issue/WOOMOB-3825-filter-history-screen
Open

Filter history: shared history screen and ViewModel#16421
AdamGrzybkowski wants to merge 5 commits into
issue/WOOMOB-3824-filter-history-foundationfrom
issue/WOOMOB-3825-filter-history-screen

Conversation

@AdamGrzybkowski

Copy link
Copy Markdown
Contributor

Part of WOOMOB-3326WOOMOB-3825

Description

Second PR in the filter history stack. Adds the shared UI, on top of the foundation from #16420. Still behind the FILTER_HISTORY flag and not reachable from any menu yet (wired up in the order/product PRs).

  • New reusable Filter History screen in Jetpack Compose (hosted in a Fragment, added to both filter nav graphs), mirroring iOS FilterHistoryView: a "Recent" list, single-select + Apply/Cancel, swipe-to-delete, "Clear History" with a confirmation dialog, and an empty state.
  • A generic FilterHistoryViewModel driven by FilterHistoryRepository, taking a source (orders/products) argument and returning the chosen SavedFilter as a nav result.
  • The 4 filter-history Tracks events (filter_history_button_tapped, _past_filter_applied, _past_filter_removed, _cleared) with a source property, matching iOS.

Test Steps

Not reachable in the app yet. CI green is the bar:

  • ./gradlew :WooCommerce:testWasabiDebugUnitTest --tests "*FilterHistoryViewModelTest*"

Stacked PRs

PR 2 of 4. Base branch: issue/WOOMOB-3824-filter-history-foundation (#16420). Review/merge #16420 first.

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

@dangermattic

dangermattic commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖

This PR contains changes to Tracks-related logic. Please ensure (author and reviewer) the following are completed:

  • The tracks events must be validated in the Tracks system.
  • Verify the internal Tracks spreadsheet has also been updated.
  • Please consider registering any new events.
  • The PR must be assigned the category: tracks label.

Generated by 🚫 Danger

@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
Commit4eca5d4
Installation URL7baakg41rmst8
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

@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 - Found 1 potential issue (a minor nit).

This is well-structured foundation work for the shared Filter History screen. It correctly follows the store-app MVVM conventions (ScopedViewModel, StateFlow via combine/toStateFlow, triggerEvent/MultiLiveEvent, Compose-in-Fragment), the swipe-to-delete + root-level nav-action patterns match existing code, SavedFilter is correctly made @Parcelize to travel as an ExitWithResult nav result, and the ViewModel is thoroughly unit-tested. No correctness, security, or backwards-compatibility concerns found.

PR housekeeping
  • Unused string resource filter_history_entry_content_description is added in strings.xml but not referenced anywhere in the diff; either wire it up (e.g. as the row's content description) or drop it to avoid a lint warning.
  • Applied repo AGENTS.md/CLAUDE.md guidance: verified this is store-management (not POS) code and validated against the store MVVM/Compose patterns.

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.

Comment thread WooCommerce/src/main/res/navigation/nav_graph_product_filters.xml Outdated
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3825-filter-history-screen branch from 81e412b to 92919ad Compare August 14, 2026 14:49
@AdamGrzybkowski AdamGrzybkowski added the category: tracks Related to analytics, including Tracks Events. label Aug 14, 2026
Adds the 4 filter history Tracks events (button tapped, past filter applied/removed, cleared) with a source property, mirroring iOS. Part 2 of WOOMOB-3326 (WOOMOB-3825).
Adds FilterHistoryFragment, Compose screen and ViewModel (single-select, swipe-to-delete, clear-all), hosted in both filter nav graphs. Part 2 of WOOMOB-3326 (WOOMOB-3825).
@AdamGrzybkowski
AdamGrzybkowski force-pushed the issue/WOOMOB-3825-filter-history-screen branch from 92919ad to cf9574f Compare August 14, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tracks Related to analytics, including Tracks Events. 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.

4 participants