Skip to content

feat: dynamic result classification (UI) - #603

Open
okt-konst wants to merge 42 commits into
ts-factory:mainfrom
okt-konst:feat/result-classification
Open

feat: dynamic result classification (UI)#603
okt-konst wants to merge 42 commits into
ts-factory:mainfrom
okt-konst:feat/result-classification

Conversation

@okt-konst

Copy link
Copy Markdown

Summary

Frontend for dynamic result classification — classify failed results from the UI, have classifications inherited by future runs, and suppress known failures from unexpected counts. Pairs with the backend PR (ts-factory/bublik#344).

Highlights:

  • Classify popover + drawer on failed results: pick/create an Issue, category, tri-state disposition (Expected / Unexpected / Don't change), and a match scope (preset + advanced toggles). Shared react-hook-form across popover and drawer.
  • Searchable issue picker (recent + title/key typeahead).
  • Admin → Issues page: list project issues with state + close/reopen; per-issue page (/admin/issues/:id) with the issue's rules (enable/disable) and a consolidated per-issue results list across all its rules/tests.
  • Run → Issues: per-run issue summary + drill-down (/runs/:id/issues), reachable from an Issues button in the run header.
  • History: category/issue/untriaged filters and issue key + category badges in the obtained-result column; disposition-colored badges.
  • Shared types + RTK endpoints/hooks for issues, rules, and classification; effective_expected/issues surfaced on run results.

Rebase note

Rebased onto current main. Upstream's 2f278f5 refactor(sidebar) replaced the monolithic bottom-nav with a per-feature nav model, so the sidebar wiring was re-implemented against the new API (Issues entry added to the Admin submenu via admin-sidebar-nav); the obsolete bottom-nav/main-nav edits were dropped. Run→Issues stays reachable via the in-page run-header button.

Test Plan

  • pnpm nx build bublik — green after rebase (incl. RunDataResultsSchema folding effective_expected/issues).
  • Reviewer: CI green; smoke-test classify flow + Admin → Issues sidebar entry.

okt-kostik added 30 commits July 7, 2026 10:36
…ification

Add the read/write API surface consumed by the result-classification
feature: shared classification types (Issue, IssueRule, ResultIssueRef,
ClassifyRequest), optional effective_expected/issues on RunDataResults,
three cache tags, and seven endpoints/hooks for issues, rules, and
result classification.
Add an admin Issues page listing project issues with state badges and
close/reopen actions. Wire the /admin/issues route and a sidebar entry
under the Admin section.
Thread categories/issue/untriaged params from URL search to the history
backend query so the list endpoint can filter by classification, and add
a Classification section (untriaged checkbox + category multi-select) to
the global search form.
…ard missing project

Result rows (issue badges + Classify popover) come from getResultsTable,
which had no providesTags, so classification mutations invalidating
BUBLIK_TAG.Run never triggered a refetch and new badges stayed hidden.

Also guard classify when no project is selected: projectId could be
undefined (no ?project= in URL), firing a request the backend rejects
with 400. The hook now blocks submit with a toast and exposes canClassify
so the popover trigger is disabled.

Drop the trailing-slash-disabling arg on the issues/issue-rules GET lists
to match convention and avoid a DRF 301 redirect.
The DRF list endpoints return {pagination, results}; the queries typed the
data as a bare array, so consumers (classify popover issue picker, IssuesTable)
crashed on .map. Add transformResponse to return response.results.
…bal selector

The Classify button was disabled under the 'ALL projects' selection because it
read projectId from useProjectSearch. Pass the result's project_id (already in
the run results response) so classify works on any run page regardless of the
global project filter.
Surface per-run classified issues so users can review and jump from a run
to the filtered History page. Adds the getRunIssues RTK endpoint (bare-list
response), RunIssuesTable, the /runs/:runId/issues route and page, and an
Issues sidebar subitem under the Run menu.
The sidebar Run->Issues subitem uses whenMatched, so the first click shows the
tutorial dialog instead of navigating (the nav system reaches sub-routes via
in-page buttons). Add a direct 'Issues' button in the run header (like Log) and
point the sidebar dialog to it.
…results

Issue rows in the run issues table now expose a clickable results count
that expands an inline tree of the classified results grouped by package
path, each showing its obtained result, verdicts and a log link.
- IssuePicker now renders inline (not a nested Popover) so selecting an option
  no longer closes the surrounding classify popover without registering.
- Run Issues table columns: Issue (key/#id) | Title | Expected | Results
  (dropped Category/State/Bug; Bug->Issue moved first).
…ssal

cmdk's focus management was dismissing the classify popover on select. Replace
it with a plain input + type=button list - can't steal focus or submit the form.
The classify popover and Customize drawer open from inside the results table,
which sits in a low stacking context, and other UI (tooltips, popovers) portals
to document.body at z-50. So the classify content rendered behind that layer;
clicking a non-form area actually hit the overlapping element - outside the
popover - and Radix dismissed it.

Add an opt-in `portal` prop to the shared Popover/Drawer (portals to
document.body, escaping the table's stacking context) and enable it for the
classify popover/drawer, kept modal like the History drawer. Raise them to
z-[100] so they sit above the z-50 portal layer (tooltips/other popovers),
otherwise a later z-50 portal still paints over them.
okt-kostik added 12 commits July 7, 2026 11:49
…in front

z-[100] put the popover/drawer above the SelectInput dropdown (z-[60]), so the
Issue/Category/scope dropdowns rendered behind the popover and their options
were unclickable ('New issue does not come up'). z-[55] stays above the z-50
tooltip layer (overlap fix intact) but below the z-60 dropdowns.
From the per-run issues view there was no path to the rule-management page; the
Issue key/id now links to /admin/issues/:id (Title still links to History).
…lumn

Render a badge per classification (bug key or #id, plus category, styled
expected/unexpected) under the obtained result in linear history.
Default the Expected selector to none/"Don't change" so classifying from the
run page does not suppress and move the result out of the unexpected view -
the result stays put and shows its issue badge.
Show all results classified under an issue (across its rules/tests) as one
newest-run-first list on the per-issue admin page, plus a Results button on
each issues-list row. Reuses the per-rule result row shape; rows carry the
matching rule's category/expected since an issue spans multiple rules.
Re-implement the sidebar link against the per-feature nav model (upstream
2f278f5 removed the monolithic bottom-nav). Adds an Issues item to the
Admin submenu; the old bottom-nav/main-nav wiring from the pre-rebase
branch is obsolete under the new architecture. Run->Issues remains
reachable via the in-page Issues button in the run header.
Satisfy the repo's prettier --check CI gate on the classification files.
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