Repository navigation
feat(app): search, filter, sort and delete SLOs in the list - #3802
alex-fedotyev wants to merge 1 commit into
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Duplicate code analysis1 new clone introduced by this PR.
If one of these duplicates a helper that already exists, import it instead jscpd compared this branch against |
E2E Test Results✅ All tests passed • 480 passed • 1 skipped • 1086s
Tests ran across 4 shards in parallel. |
Adds a toolbar to the SLO list: a search over name, description and tags, a tag filter (every picked tag must match, as on the dashboards list), a source filter when the SLOs use more than one source, and a sort by worst first, name, lowest SLI, least budget left or fastest burn. SLOs without numbers yet sort last. The filters and the sort live in the URL. Each row gets a menu to delete the SLO, which deletes its burn alerts too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4769ccf to
521cad5
Compare
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
| clearable | ||
| w={200} | ||
| data-testid="slo-source-filter" | ||
| /> |
There was a problem hiding this comment.
🟡 P2 — A source filter that is not in the options shows "All sources" while hiding every row
Unlike the tag MultiSelect, which merges tagFilter into data, the source Select only lists sources. If ?source= holds an id no SLO uses (an old link, or you just deleted the last SLO on that source), the Select falls back to the "All sources" placeholder but the list is still filtered to nothing. Add the current sourceFilter to data when it is missing (for example with an 'Unknown source' label), the same way the tag filter handles stale values.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| const { tagOptions, sourceOptions } = useMemo(() => { | ||
| const sourceIds = [...new Set((slos ?? []).map(slo => slo.source))]; | ||
| return { | ||
| tagOptions: [...new Set((slos ?? []).flatMap(slo => slo.tags))].sort(), |
There was a problem hiding this comment.
🟡 P2 — Tag options are deduped case-sensitively, but the filter matches tags case-insensitively
new Set(slos.flatMap(slo => slo.tags)) lists 'Prod' and 'prod' as two options, yet picking either one matches both because the filter lowercases. The dashboards list deals with this by collapsing case variants into one option (see the comment in components/Dashboards/dashboardsListUtils.ts:78). Dedupe the options by toLowerCase() here too.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| sloStateLabel, | ||
| } from './sloUtils'; | ||
|
|
||
| function matchesSearch(slo: SloApiResponse, term: string) { |
There was a problem hiding this comment.
🟡 P2 — Search joins all the fields into one string, so a term can match across field boundaries
[name, description, ...tags].join(' ').includes(term) matches a term like 'api prod' when the name ends in 'api' and a tag is 'prod', which no single field contains. Test each field on its own ([name, description, ...tags].some(f => f.toLowerCase().includes(q))), as filterAndSortDashboards in components/Dashboards/dashboardsListUtils.ts:89 does.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
PR Review
7 finding(s): 🔴 0 P0/P1 · 🟡 4 P2 · 🔵 3 P3 3 posted as inline comment(s) on the changed lines. 1 listed below. 3 P3 folded at the bottom. Findings outside the changed lines
🔵 3 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. No P0/P1 defects: the sort comparators are crash-safe (optional chaining guards nullish status and empty burn arrays), null handling in 🟡 P2 — recommended
🔵 P3 nitpicks (7)
Reviewers (8): correctness, adversarial, kieran-typescript, julik-frontend-races, testing, maintainability, project-standards, agent-native. Prior PR comments were bot-only (changeset, Vercel, jscpd on an unrelated API file, e2e results) with no human review threads to verify. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
Summary
Adds a toolbar to the SLO list: a search over name, description and tags,
a tag filter (every picked tag must match, as on the dashboards list), a
source filter when the SLOs use more than one source, and a sort by worst
first, name, lowest SLI, least budget left or fastest burn. SLOs without
numbers yet sort last. The filters and the sort live in the URL. Each row
gets a menu to delete the SLO, which deletes its burn alerts too.
Stack
Part 15 of 27 PRs in a GitHub stack (stack #3815). The header says this PR merges into the branch below it, but the stack's base is
main: merging a PR lands it and every PR below it onmain, one squashed commit each. Each diff is only its own change, and CI runs as if each PR targetsmain.Parts 1 to 6 are shared code, 7 to 13 the API and its MCP tools, and 14 to 27 the app. Everything ships behind
ENABLE_SLOS(API) andNEXT_PUBLIC_ENABLE_SLOS(app), both off by default.Screenshots or video
How to reproduce
Starting point:
yarn devon this branch (the pages need the API)..env.developmentturns onENABLE_SLOSandNEXT_PUBLIC_ENABLE_SLOS(parts 7 and 14). Use a trace or log source with data; the demo server works.On the previous part: the list has no toolbar or row menu.
On this branch:
Test plan
components/Slos/__tests__/sloList.test.ts(sort)How to test on Vercel preview
N/A: SLOs need the API, and the preview runs in local mode, where they are off.
References
[no-changeset: allow] The changeset for this piece is in part 27.
[no-story: allow] The new SLO components are page-level and fed by queries and form state, so this feature has no Storybook stories.
[ui-states: allow] The list's empty, loading and error states are part 14's.