Skip to content

feat: Add advanced filters panel to incident list#126

Open
spalmurray wants to merge 20 commits intomainfrom
spalmurray/advanced-filters-ui
Open

feat: Add advanced filters panel to incident list#126
spalmurray wants to merge 20 commits intomainfrom
spalmurray/advanced-filters-ui

Conversation

@spalmurray
Copy link
Copy Markdown
Contributor

@spalmurray spalmurray commented Mar 11, 2026

Adds an expandable advanced filters panel to the incident list page with filters for severity, service tier, impact type, affected service, affected region, root cause, captain, reporter, and created date range. Filters use a draft/commit pattern where selections are stored locally during editing and flushed to URL params on close. The grid layout is responsive (1 col → 2 col → 3 col). Captain and reporter filters support server-side search with infinite scroll.

Screenshot 2026-03-11 at 16 43 34

@spalmurray spalmurray marked this pull request as ready for review March 11, 2026 20:55
@spalmurray spalmurray requested a review from a team as a code owner March 11, 2026 20:55
@spalmurray spalmurray force-pushed the spalmurray/advanced-filters-ui branch from ccb3a5c to 8e2b626 Compare March 12, 2026 00:13
@spalmurray spalmurray force-pushed the spalmurray/advanced-filters-ui branch from 055d7fe to ec862c8 Compare April 9, 2026 17:09
Comment on lines +19 to +23
to: '/',
search: {},
replace: true,
});
}}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Clicking "Clear all filters" incorrectly removes the status URL parameter, resetting the user's selected status tab to the default.
Severity: MEDIUM

Suggested Fix

Update the onClick handler in FilterTrigger.tsx to preserve existing URL search parameters when clearing filters. Instead of search: {}, use a functional update like search: s => ({ ...s, ...clearedFilters }) to only remove the relevant filter keys, preserving others like status.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: frontend/src/routes/components/filters/FilterTrigger.tsx#L19-L23

Potential issue: The "Clear all filters" button in `FilterTrigger.tsx` clears all URL
search parameters by calling `navigate` with `search: {}`. When a user is on a
non-default status tab, such as "In Review", the `status` is stored in the URL. If the
user applies advanced filters and then clicks "Clear all filters", this action will
remove not only the advanced filter parameters but also the `status` parameter, causing
the view to unexpectedly reset to the default "Active" status tab.

@spalmurray spalmurray force-pushed the spalmurray/advanced-filters-ui branch from ec862c8 to 19df7d2 Compare April 9, 2026 17:41
)}
</div>
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PillFilter and TagFilter have heavily duplicated JSX

Low Severity

PillFilter and TagFilter share ~120 lines of nearly identical JSX (header, editing mode, display mode, dropdown, backdrop). They differ only in how individual options are rendered (Pill component vs plain text). The shared state logic is already in useFilterEditor, but the rendering duplication means any bug fix or feature change needs to be applied in both places, risking inconsistency.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 19df7d2. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a4b6bc0. Configure here.

)}
</div>
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PillFilter and TagFilter have near-identical template code

Low Severity

PillFilter and TagFilter share ~120 lines of nearly identical JSX — the header, edit mode input, display mode tags, dropdown list, and backdrop overlay are all copy-pasted. The only meaningful differences are item rendering (Pill component vs plain text) and data source (static options prop vs useQuery). A single generic component accepting a renderItem callback and an options array would eliminate this duplication and ensure future fixes (e.g., accessibility, styling) apply consistently.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a4b6bc0. Configure here.

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.

1 participant