Skip to content

Filter history: foundation (feature flag + Room persistence) - #16420

Open
AdamGrzybkowski wants to merge 3 commits into
trunkfrom
issue/WOOMOB-3824-filter-history-foundation
Open

Filter history: foundation (feature flag + Room persistence)#16420
AdamGrzybkowski wants to merge 3 commits into
trunkfrom
issue/WOOMOB-3824-filter-history-foundation

Conversation

@AdamGrzybkowski

Copy link
Copy Markdown
Contributor

Part of WOOMOB-3326WOOMOB-3824

Description

First of a stack of PRs adding filter history to the order and product lists (feature request WOOMOB-31, matching the iOS implementation). Everything is gated behind the new FILTER_HISTORY feature flag and is not user-visible yet.

This foundation PR adds the persistence layer only — no UI:

  • New FILTER_HISTORY feature flag (woo_filter_history, debug-on).
  • A Room-backed, per-site FilterHistory table (entity + DAO) added to FluxC's WCAndroidDatabase (version 91 → 92, one auto-migration), following the Support Chat bookmark precedent.
  • A main-app FilterHistoryRepository exposing per-surface observe/save/remove/clear, with dedup + newest-first + unlimited history (matching iOS), and a SavedFilter domain model.

The stored payload is an opaque, per-surface serialization (decoded by the order/product screens in later PRs), so adding new filters later needs no schema migration.

Test Steps

No user-facing behaviour. CI green is the bar:

  • ./gradlew :libs:fluxc-plugin:testDebugUnitTest --tests "*FilterHistoryDaoTest*" — covers dedup / newest-first / delete / clear / per-site isolation on an in-memory DB.

Stacked PRs

This is PR 1 of 4, targeting trunk. The rest target the previous branch:

  1. (this) foundation — trunk
  2. shared filter history screen
  3. order list integration
  4. product list integration
  • I have considered if this change warrants release notes — none needed (behind feature flag, not user-facing).

Adds FILTER_HISTORY flag, FilterHistoryEntity/Dao in WCAndroidDatabase (v92) and a per-site FilterHistoryRepository. Part 1 of WOOMOB-3326 (WOOMOB-3824).
@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.

Generated by 🚫 Danger

@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 is a well-scoped foundation PR (feature flag + Room persistence for filter history). The DB version bump 91→92 adds a brand-new empty table via AutoMigration(91, 92), which Room handles automatically, and the schema 92.json is committed — the migration is deploy-safe. The dedup-by-payload contract (unique index on (localSiteId, filterType, payload) + OnConflictStrategy.REPLACE) is implemented correctly and well covered by the DAO tests (dedup/bump, site isolation, clear scoping, newest-first ordering). No correctness, security, or backwards-compatibility concerns.


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 added this to the 25.5 milestone Aug 14, 2026
@AdamGrzybkowski AdamGrzybkowski added New Feature status: feature-flagged Behind a feature flag. Milestone is not strongly held. labels Aug 14, 2026
@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
Commit06d5063
Installation URL7h3tsn9q0i2s8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

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.

3 participants