feat(inbox): show report tags on cards and filter the list by tag, behind a flag
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- django, python, react, typescript
- Domain
- full-stack
Research direction
Start with the backend filter: read _apply_signal_report_source_product_filter in products/signals/backend/views.py and the report list viewset actions that call it, then mirror that shape for tags using normalize_report_tags and MAX_TAGS. On the frontend, read products/signals/frontend/inbox/logics/inboxFiltersLogic.ts and follow the Source filter pattern end to end (reportListLogic.ts, InboxReportFilters.tsx, ReportCard.tsx) plus the flag entry in frontend/src/lib/constants.tsx. Done means the flag-gated chips and Tags menu work, the backend tests for the tags filter pass, the OpenAPI schema and MCP tool are regenerated, and the new stories render. Expect to check the query plan for a rare tag and add a concurrent GIN index on SignalReport.tags if it is slow.
Written by the indexing model from the issue text.
Description
Problem
Inbox reports carry tags: free-form lowercase kebab-case slugs such as tracking-gap or silent-failure, at most 10 per report. Scouts and the report pipeline write them, and the report API already returns them in tags.
The inbox does not use them. A user cannot see a report's tags on its card, and cannot narrow the report list to one kind of report, for example every docs-gap report.
We want users to see tags on report cards and filter the report list by tag. The change ships behind a new feature flag so it can be tried on a few accounts first.
Mockup (PostHog staff only): https://us.posthog.com/code/canvas/b3c84ed2-6999-4b81-beff-30350198f9ad/01a1d417-8c7a-74ae-8fcf-76704fefd2bc. This issue builds display option A and filter option 2 from the mockup.
Replaces #120483. The earlier attempt, #120549, was closed without merging and had no feature flag. Reuse what still applies from it.
Scope
- Redesigned inbox layout only (
ReportsTab,InboxReportFilters,ReportCard). - One new frontend feature flag,
inbox-tag-filter, gates both the tags on cards and the filter. With the flag off the inbox looks and behaves as it does today. - The backend
tagslist parameter is not flag-gated. It is a plain filter on data the API already returns. - No change to how tags are written, normalized, or merged (
products/signals/backend/report_tags.py). - Out of scope: a "match all tags" mode, a top-tags bar above the list, per-tag report counts, editing tags from the inbox, and the report detail view.
Changes
1. Backend: tags filter on the report list
In products/signals/backend/views.py:
- Add a
tagsquery parameter to the report list, next tosource_productandscout: a comma-separated list of tag slugs. A report is kept when it has at least one of the tags (array overlap). It combines with every other filter as AND. - Add
_apply_signal_report_tags_filterbeside_apply_signal_report_source_product_filterand call it in the same places, so list counts and sections respect it the same way. - Normalize the incoming values with
normalize_report_tagssoDocs Gapanddocs-gapmatch the same reports. Ignore empty values. Cap the number of tags a request may pass atMAX_TAGS. - Write the
OpenApiParameterdescription, then runhogli build:openapi. - Expose the same
tagsfilter on theinbox-reports-listMCP tool, following/implementing-mcp-tools.
Query cost: team_tag_vocabulary already notes that a SQL filter on tags can walk a team's whole history when few reports match. Check the plan for a rare tag on a large team with /profiling-slow-api-endpoints. If it needs one, add a GIN index on SignalReport.tags, created concurrently, following /django-migrations.
2. Backend: tag options for the filter
Add a read-only list-level action on the report viewset that returns the team's most-used tags, most-used first, from team_tag_vocabulary(team.id). Response: { "tags": string[] }. Give it a response serializer so the generated types are exact.
3. Frontend: flag and filter state
- Add
INBOX_TAG_FILTER: 'inbox-tag-filter'toFEATURE_FLAGSinfrontend/src/lib/constants.tsx, with the same owner comment style asINBOX_SOURCE_FILTER. - In
products/signals/frontend/inbox/logics/inboxFiltersLogic.ts, follow the Source filter pattern:tagFilter: string[]withtoggleTag(tag)andclearTagFilter().tagFilterAvailablereads the flag.activeTagFilterreturns[]while the flag is off, so a stored or shared selection cannot narrow a list that has no control for it.- Sync to the URL as
tags=a,b, parsed like thescoutparam. - Capture the change through
captureQueryChange('tags'). Add'tags'toInboxQueryChangeininboxAnalytics.ts.
- In
reportListLogic.ts, sendtags: activeTagFilter.join(',')with the list request when it is not empty, and reload when it changes. - Load the tag options from the new action only when the flag is on.
4. Frontend: Tags filter control
Add InboxTagFilter.tsx in components/shell/ and render it in InboxReportFilters.tsx after the Source filter, only when tagFilterAvailable.
- Trigger: a button labelled "Tags", or "Tags · {n}" when n tags are selected.
- Menu: a search field, then a checkbox row per tag from the options, most-used first. Search narrows the rows. Selected tags that are not in the options still show as checked rows, so a tag picked from a card can always be cleared.
- Empty state when the team has no tags: "No tags yet".
- Clearing all inbox filters also clears the tag filter.
5. Frontend: tags on the report card
In components/cards/ReportCard.tsx, when tagFilterAvailable and the report has tags:
- Show the tags as small neutral chips in a row under the title line. Show at most 3, then a
+{n}chip that reveals the rest on hover. - Tags in the active filter render in the highlighted style and sort to the front, so the matching tag is never hidden in the overflow.
- Selecting a chip toggles that tag in the filter. It must not open the report or select the card. Chips are real buttons: focusable, with
aria-pressed. - A report with no tags shows no row, so cards without tags keep their current height.
6. Tests
- Backend: the
tagsfilter keeps reports with any of the given tags, combines withstatusas AND, normalizes input, and ignores an empty value. - Frontend logic:
activeTagFilteris empty with the flag off, and thetagsURL param round-trips. - Add a story for a card with more than 3 tags and one for the open Tags menu.
Rollout
Create the inbox-tag-filter flag at 0% and target individual users first. Rollback is turning the flag off.
- Dominant language
- Python
- Stars
- 40.8k
- Forks
- 3.6k
- Avg merge
- 6h 43m
- Merged PRs (30d)
- 254
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PostHog/posthog
-
self-driving
Difficulty 1/5 Under an hour Newbie friendliness 74/100
PostHog/posthog#136106 · 1 comment ·
Maintainers usually reply within 1 day
-
Dashboards: selecting a SQL variable value equal to its default is dropped when the dashboard saved another valuePossibly taken @Inf1mum claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
PostHog/posthog#132024 · 1 comment ·
Maintainers usually reply within 1 day
-
self-driving
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PostHog/posthog#130181 · 2 comments ·
Maintainers usually reply within 1 day
-
posthog-cli api: `call`, `info` and `search` read `--help` as a tool namePossibly taken @lazerg claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
PostHog/posthog#129166 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PostHog/posthog#128849 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
huggingface/kernels#1006 ·
Maintainers usually reply within 1 day
-
precond_kda (new op, #1552) backward kernels hit CUDA illegal memory access on Blackwell under triton 3.3.1, pass under triton 3.7.1Possibly taken @YYuJLiu claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
fla-org/flash-linear-attention#1749 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bridgecrewio/checkov#7804 ·
Maintainers usually reply within 2 days
-
area:filesystem bug need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agentscope-ai/agentscope#4068 ·
Maintainers usually reply within 2 days