Skip to content

feat(inbox): add "Any" option to Source and Priority filters#3493

Merged
trunk-io[bot] merged 3 commits into
mainfrom
posthog-code/inbox-filter-any-option
Jul 16, 2026
Merged

feat(inbox): add "Any" option to Source and Priority filters#3493
trunk-io[bot] merged 3 commits into
mainfrom
posthog-code/inbox-filter-any-option

Conversation

@pauldambra

Copy link
Copy Markdown
Member

Problem

In the inbox toolbar, the Source and Priority filter dropdowns had no explicit way to get back to "no filter". Once you picked one or more values, the only way to clear was to manually unselect each one — there was no "Any" affordance, which is unintuitive (raised in the Slack thread linked below).

Changes

  • Add an Any row as the first item in both the Source and Priority filter popovers.
  • "Any" is shown as selected (check mark) whenever no specific value is selected, and clicking it clears that filter back to empty.
  • Unselecting the last remaining option collapses to the same empty state — i.e. it is equivalent to clicking "Any".
  • Backed by two small per-filter store actions (clearSourceProductFilter, clearPriorityFilter); empty array still means "all", so no query/serialization changes.

Note: the mobile FilterSheet uses a different paradigm (a sheet with a global "Reset" button), so it's left as-is; we can mirror the per-select "Any" there as a follow-up if desired.

How did you test this?

  • pnpm --filter @posthog/ui test inboxSignalsFilterStore — 14 tests pass, including new cases for clearPriorityFilter, clearSourceProductFilter, and "toggling off the last source is equivalent to Any".
  • pnpm --filter @posthog/ui typecheck — clean.
  • biome lint on the changed files — clean.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog from a Slack thread

The inbox Source and Priority filter popovers had no explicit way to go
back to "no filter" — you had to manually unselect each choice. Add an
"Any" row at the top of each popover that is checked when nothing else is
selected and clears that filter when clicked. Unselecting the last option
already collapses to the same empty ("Any") state.

Generated-By: PostHog Code
Task-Id: 97aa95fe-d9a3-4651-aa9b-9f636fc84832
@trunk-io

trunk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 242da08.

@pauldambra
pauldambra marked this pull request as ready for review July 16, 2026 09:44

@pauldambra pauldambra left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note

🤖 Automated comment by QA Swarm — not written by a human

Multi-perspective review (paul-reviewer, xp-reviewer, security-audit; qa-team unavailable in this environment). Verdict: ✅ APPROVE WITH NITS — no correctness or security issues, only nit/low suggestions inline.

Comment thread packages/ui/src/features/inbox/components/InboxSearchFilterBar.tsx Outdated
Comment thread packages/ui/src/features/inbox/components/InboxSearchFilterBar.tsx Outdated
Comment thread packages/ui/src/features/inbox/components/InboxSearchFilterBar.tsx
Comment thread packages/ui/src/features/inbox/stores/inboxSignalsFilterStore.ts

Copy link
Copy Markdown
Member Author

Note

🤖 Automated comment by QA Swarm — not written by a human

Multi-perspective review: paul-reviewer, xp-reviewer, security-audit (qa-team unavailable in this environment)

Verdict: ✅ APPROVE WITH NITS

Small, focused change that does exactly one thing: makes the already-documented "empty = Any" filter state reachable from the UI. No correctness bugs, no security surface, store actions are tested.

Key findings

  • 🟢 LOW — clearSourceProductFilter/clearPriorityFilter overlap with resetFilters/setPriorityFilter([]); keep for call-site readability but single-source the "empty = Any" invariant. (convergent: paul + xp)
  • 🟢 LOW — no data-attr on the filter buttons; this is a measuring surface, cheap to add now (pre-existing gap, not a regression). (paul)
  • ⚪ NIT — InboxFilterAnyItem's label prop is always "Any" — could hardcode. (convergent: paul + xp)
  • ⚪ NIT — "Any" row sits flush-left vs icon-indented siblings. (paul)
  • ⚪ NIT — the "toggling off the last source" test characterizes pre-existing behavior. (xp)

Convergence

Two findings were flagged independently by both paul and xp (higher confidence): the always-"Any" label prop, and the clear-action / resetFilters overlap.

Reviewer summaries

Reviewer Assessment
👤 paul Clean, does one thing; only itch is observability (pre-existing). Ship it.
📐 xp Well-shaped, no YAGNI violations; nice InboxFilterAnyItem extraction. Ship it.
🛡 security-audit Security-neutral — no user-controlled data flow, no new auth/injection surface.

Automated by QA Swarm — not a human review

Generated-By: PostHog Code
Task-Id: 97aa95fe-d9a3-4651-aa9b-9f636fc84832
…iorityFilter([])

simplify pass: setPriorityFilter([]) already expresses "clear priority to Any", so the dedicated clearPriorityFilter action was pure duplication. clearSourceProductFilter is kept since the source filter has no equivalent setter.

Generated-By: PostHog Code
Task-Id: 97aa95fe-d9a3-4651-aa9b-9f636fc84832
@tatoalo
tatoalo enabled auto-merge (squash) July 16, 2026 11:58

Copy link
Copy Markdown
Member Author

Merge activity

  • Jul 16, 11:58 AM UTC: A user started a stack merge that includes this pull request via Graphite.

@trunk-io
trunk-io Bot merged commit 929dfea into main Jul 16, 2026
32 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/inbox-filter-any-option branch July 16, 2026 12:09
Gilbert09 added a commit that referenced this pull request Jul 20, 2026
Ports #3493 to the mobile filter sheet. Adds an "Any" row at the top of the
Source and Priority sections that reads as selected when the filter is empty
and clears the filter back to empty when tapped. Source clears via a new
clearSourceProductFilter store action; Priority reuses setPriorityFilter([]).

Generated-By: PostHog Code
Task-Id: be78b0df-c31b-4e0e-8d37-feaf22a054d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants