Skip to content

feat(app): search, filter, sort and delete SLOs in the list - #3802

Open
alex-fedotyev wants to merge 1 commit into
alex/HDX-3001-slo-14-app-listfrom
alex/HDX-3001-slo-15-app-list-actions
Open

alex-fedotyev wants to merge 1 commit into
alex/HDX-3001-slo-14-app-listfrom
alex/HDX-3001-slo-15-app-list-actions

Conversation

@alex-fedotyev

@alex-fedotyev alex-fedotyev commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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 on main, one squashed commit each. Each diff is only its own change, and CI runs as if each PR targets main.

  1. feat(common-utils): SLO definition schema #3788 common-utils: SLO definition schema
  2. feat(common-utils): SLO fast and slow burn rules #3789 common-utils: SLO fast and slow burn rules
  3. feat(common-utils): SLO alert targets and status types #3790 common-utils: SLO alert targets and status types
  4. feat(common-utils): SLO counts query #3791 common-utils: SLO counts query
  5. feat(common-utils): SLO stats and state #3792 common-utils: SLO stats and state
  6. feat(common-utils): SLO history and ordering #3793 common-utils: SLO history and ordering
  7. feat(api): SLO definitions behind ENABLE_SLOS #3794 api: SLO definitions behind ENABLE_SLOS
  8. feat(api): refresh SLO statuses in the check-alerts task #3795 api: refresh SLO statuses in the check-alerts task
  9. feat(api): SLO burn alerts as their own alert source #3796 api: SLO burn alerts as their own alert source
  10. feat(api): keep SLO alerts out of the external alerts API #3797 api: keep SLO alerts out of the external alerts API
  11. feat(api): evaluate SLO burn alerts and notify #3798 api: evaluate SLO burn alerts and notify
  12. feat(api): clickstack_get_slo MCP tool #3799 api: clickstack_get_slo MCP tool
  13. feat(api): SLO preview, save and delete MCP tools #3800 api: SLO preview, save and delete MCP tools
  14. feat(app): SLO list page behind NEXT_PUBLIC_ENABLE_SLOS #3801 app: SLO list page behind NEXT_PUBLIC_ENABLE_SLOS
  15. feat(app): search, filter, sort and delete SLOs in the list #3802 app: search, filter, sort and delete SLOs in the list (this PR)
  16. feat(app): SLO builder for a new SLO #3803 app: SLO builder for a new SLO
  17. feat(app): SLO objective, details and editing in the builder #3804 app: SLO objective, details and editing in the builder
  18. feat(app): eligible-event filters and the latency template in the builder #3805 app: eligible-event filters and the latency template in the builder
  19. feat(app): preview an SLO in the builder before saving it #3806 app: preview an SLO in the builder before saving it
  20. feat(app): create an SLO from a search, and duplicate an SLO #3807 app: create an SLO from a search, and duplicate an SLO
  21. feat(app): SLO detail page #3808 app: SLO detail page
  22. feat(app): bad events flyout on the SLO page #3809 app: bad events flyout on the SLO page
  23. feat(app): SLI, error budget and burn rate charts on the SLO page #3810 app: SLI, error budget and burn rate charts on the SLO page
  24. feat(app): fast and slow burn alerts in the SLO builder, list and page #3811 app: fast and slow burn alerts in the SLO builder, list and page
  25. feat(app): SLO alerts on the Alerts page #3812 app: SLO alerts on the Alerts page
  26. feat(app): group-by in the SLO builder #3813 app: group-by in the SLO builder
  27. feat(app): grouped SLOs in the list and on the SLO page #3814 app: grouped SLOs in the list and on the SLO page

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) and NEXT_PUBLIC_ENABLE_SLOS (app), both off by default.

Screenshots or video

Before After
before, light after, search and the row menu, light
after, dark

How to reproduce

Starting point: yarn dev on this branch (the pages need the API). .env.development turns on ENABLE_SLOS and NEXT_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:

  1. Type in the search box, pick a tag or a source, change the sort: the list follows, and the URL keeps them.
  2. Open a row's menu and delete an SLO.

Test plan

  • unit: components/Slos/__tests__/sloList.test.ts (sort)
  • states: a search that matches nothing shows "No matching SLOs"
  • viewport: checked at 1440 px and in a narrow 900 px window. The list scrolls sideways and its toolbar wraps, the builder's preview moves under the form, and the SLO page's stats wrap to two columns.
  • app typecheck, lint and knip at this commit

How to test on Vercel preview

N/A: SLOs need the API, and the preview runs in local mode, where they are off.

References

  • Linear Issue: HDX-3001
  • Related PRs: the rest of this stack, listed above

[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.

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 521cad5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 24, 2026 7:01pm UTC
hyperdx-storybook Ready Ready Preview Nov 24, 2026 7:01pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Duplicate code analysis

1 new clone introduced by this PR.

  • packages/api/src/routers/external-api/v2/alerts.ts:908-925 ↔ packages/api/src/routers/external-api/v2/alerts.ts:1181-1197 — 18 lines

If one of these duplicates a helper that already exists, import it instead
of redefining it. If the duplication is deliberate, ignore this comment —
the check is advisory and never fails the build.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 108 in total (1.11%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 480 passed • 1 skipped • 1086s

Status Count
✅ Passed 480
❌ Failed 0
⚠️ Flaky 8
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

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>
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Tier 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Diff size: 303 production lines changed (Tier 2 max: < 250)

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

Stats
  • Production files changed: 6
  • Production lines changed: 303 (+ 77 in test files, excluded from tier calculation)
  • Branch: alex/HDX-3001-slo-15-app-list-actions
  • Author: alex-fedotyev

To override this classification, remove the review/tier-3 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

clearable
w={200}
data-testid="slo-source-filter"
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

@github-actions

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

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

  • 🟡 P2 packages/app/src/components/Slos/sloListSort.ts:433 — Number sorts have no name tiebreak, so tied rows stay in API order → Healthy SLOs often tie on burn rate (for example 0) or budget. byNumber then returns 0 and those rows keep whatever order the API returned. The dashboards sort breaks ties by name (compare(...) || a.name.localeCompare(b.name) in dashboardsListUtils.ts:99). Add || a.name.localeCompare(b.name) to the non-name comparators.
🔵 3 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/components/Slos/SlosListPage.tsx:72 — Filter logic is written inline in the page and has no tests, unlike the dashboards list → The dashboards list keeps its search, tag and sort logic in dashboardsListUtils.ts (filterAndSortDashboards) next to its tests. Here the search, tag-AND, state and source filtering are inline in the component, and sloList.test.ts covers only compareSlos. Move matchesSearch and the filter into sloListSort.ts (or a sloListUtils.ts) as one filterAndSortSlos, and test tag casing, the AND across tags, and search.
  • 🔵 P3 packages/app/src/components/Slos/SloRowMenu.tsx:146 — stopPropagation calls do nothing because the row has no click handler → SloRow's Table.Tr in SloTable.tsx has no onClick, and the dropdown is portalled, so the two e.stopPropagation() handlers have no effect. Remove them, or add them in the PR that makes rows clickable.
  • 🔵 P3 packages/app/src/components/Slos/__tests__/sloList.test.ts:400 — The 'worst' sort test checks only the first element → expect(sorted('worst')[0]).toBe('a') would still pass if the rest were in any order, for example the pending SLO before 'b'. Assert the full order, as the other cases do.

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.

@github-actions

Copy link
Copy Markdown
Contributor

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 byNumber is correct, the switch is exhaustive over SloSort, nuqs clear-to-null is sound, and the delete flow awaits mutateAsync and surfaces errors. The notes below are reliability/UX polish and test coverage.

🟡 P2 — recommended

  • packages/app/src/slo.ts:37 — useDeleteSlo only invalidates the ['slos'] query on success with no optimistic removal and no pending guard, so the deleted row stays mounted and clickable through the refetch round-trip (up to the 60s poll window if a poll fetch is already in flight and the invalidation dedupes into it), letting a second delete hit a now-missing id and surface a red "Could not delete" toast that contradicts the green success toast.
    • Fix: Remove the row optimistically via queryClient.setQueryData in onSuccess (or onMutate), or disable the menu item while deleteSlo.isPending.
    • adversarial, julik-frontend-races
  • packages/app/src/components/Slos/SlosListPage.tsx:43 — The new matchesSearch helper and the four-way filter predicate (search, state, every-tag-must-match, source) are inline and untested, and the SloRowMenu delete flow including its error/catch branch has no coverage, while the sibling Dashboards/dashboardsListUtils.ts extracts a pure filter util with its own test.
    • Fix: Extract the filter predicate into sloListSort.ts (or a sloListUtils.ts) and add unit tests for AND composition, case-insensitive search and tag matching, source exclusion, plus SloRowMenu tests for the confirm-declined, success, and error-toast branches.
    • testing, kieran-typescript, maintainability, project-standards
🔵 P3 nitpicks (7)
  • packages/app/src/components/Slos/SlosListPage.tsx:63 — tagFilter uses parseAsArrayOf(parseAsString) whose default separator is ,, so selecting a tag that itself contains a comma round-trips through the URL as two tokens and the every match silently filters the list to empty.
    • Fix: Use a separator that cannot appear in a tag (e.g. parseAsArrayOf(parseAsString, '�')) or encode tag values before serializing.
    • adversarial
  • packages/app/src/components/Slos/SlosListPage.tsx:65 — The source query param is unvalidated, so a stale deep link to a removed source filters the list to empty and the Mantine Select shows no label for the out-of-data value, leaving the cause non-obvious (recoverable only via the clearable X).
    • Fix: Validate source against the current source ids and reset to null when it no longer matches, mirroring the enum handling used for sort.
    • correctness, adversarial, kieran-typescript
  • packages/app/src/components/Slos/SloListToolbar.tsx:56 — Tag matching lowercases both sides but the MultiSelect options dedup case-sensitively via [...new Set([...tags, ...tagFilter])], so a stale Prod in the URL alongside a live prod tag renders two near-identical chips.
    • Fix: Dedup on a lowercased key while preserving a display label.
    • correctness, adversarial
  • packages/app/src/components/Slos/sloListSort.ts:47 — The burn sort reads slo.status?.burn[0]?.burnRate, silently depending on SLO_BURN_CONDITIONS ordering fastBurn first, while the comment says "the 1h condition".
    • Fix: Select by rule — slo.status?.burn.find(c => c.rule === 'fastBurn')?.burnRate.
    • maintainability
  • packages/app/src/components/Slos/SloListToolbar.tsx:66 — data={SLO_SORT_OPTIONS.map(o => ({ ...o }))} clones only to strip the as const readonly typing for Mantine's mutable data prop, with nothing explaining why.
    • Fix: Add a one-line comment, or export SLO_SORT_OPTIONS typed as a mutable { value; label }[] so no clone is needed.
    • maintainability
  • packages/app/src/slo.ts:37 — useDeleteSlo omits useMutation generics, so data resolves to the raw ky Response and the error channel defaults to Error while ky throws HTTPError, diverging from the useDeleteOrgApiKey convention in api.ts.
    • Fix: Type it as useMutation<unknown, Error | HTTPError, string>({ ... }).
    • kieran-typescript
  • packages/app/src/components/Slos/__tests__/sloList.test.ts:76 — The worst sort assertion checks only sorted('worst')[0], and no fixture exercises byNumber's equal-value or null-vs-null tie-breaks or the isSloSort guard.
    • Fix: Assert the full worst ordering with toEqual, add fixtures with duplicate sort values and two pending SLOs, and add direct isSloSort cases.
    • testing

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. agent-native confirmed parity: clickstack_delete_slo already mirrors the UI delete action.

Testing gaps:

  • Filter/search composition in SlosListPage (AND semantics, case-insensitive tag every-match, source filter) has no unit test.
  • Delete flow (SloRowMenu confirm/success/error branches, useDeleteSlo cache invalidation) is untested, including the error toast path.
  • The "No matching SLOs" empty-after-filter state exists but has no test.

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

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 521cad53 Deployed Nov 24, 2026 by vercel[bot]
Preview – hyperdx-storybook — 521cad53 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant