Skip to content

Gold Standard row/expand contract ​

The row and expand contract every widget in the registry follows.

Every finding widget renders its content as N≄1 rows. Its <Widget>.rows.ts decides the rows and its <Widget>.tsx renders one of them through the shell (see Finding widget shell). RetryWaste.rows.ts and RetryWaste.tsx are the smallest example; Skew.tsx shows a row with a toggle. A widget's data shape (chart, table, single app-scoped scalar) is never by itself a reason to skip this: the four named exceptions below (one histogram toggle, three partial exceptions) are the only ones. Any further exception must get its own entry here, justified in the same PR that introduces it.

  • Tier A (universal), all from the shell: WidgetCard chrome with the core finding name as its title, an impact-band left-border + dot, the ALL-CAPS TagBadge, a SortModeToggle when the rows can be re-sorted, a finding-anchor ref on every row, the route index and the paging. A widget file writes none of these. A widget mounts when rows(...) is not empty and renders nothing otherwise. Core Locality is the one always-mounted widget: its model sets alwaysMounted, and it renders from appModel via alwaysMountedWidgets()/isAlwaysMountedType() even with no rows.
  • Tier B (the row/expand pattern): a row's collapsed state shows its core metric(s), ImpactEstimate, any config-hint code snippet/list, and docs links, all unconditionally. The fix is stated once per card: WidgetCard's fixFor prints each distinct coreFindingGenericRecommendation above the body, so rows don't repeat a recommendation that restates their number. The shell passes the shown findings for every widget, Shuffle I/O and the Skew, Stage Shape and Tiny Tasks groups (StageGroup) included. A type with no generic fix, Incomplete Run, prints none. Where the detector's sentence is a row's only measurement (Excessive Small Files, Missed Broadcast Join, Oversized Broadcast Join, Config Audit), the row shows its measured half, split off by core's recommendationParts. Three rows keep their own sentence because their type has no generic fix for them: Incomplete Run, and a data-unavailable Memory Utilization or Cache Utilization row, which names the setting to enable. Confidence and evidence are unconditional too: RowStatusCluster (src/view/RowStatusCluster.tsx) is a single, fixed-position pill combining both. It only renders at the Advanced density tier, and the row decides that as data: its rows function sets a showStatus flag from the density, and the Row renders the cluster only when the flag is set. A widget file does not wrap it in AdvancedOnly. This is a content-visibility gate (Basic vs. Advanced), not a per-row collapse, and every adopting widget applies it the same way. No widget gates confidence or evidence behind a per-row click. A widget-header RowStatusCluster (the view's Status slot, which the shell passes to WidgetCard as statusBadge) carries one further, unrelated gate on top of the density: open && statusBadge (WidgetCard.tsx's header) keeps it out of the collapsed header, matching the comment on statusBadge itself ("kept separate so tag/impact badges stay visible in the collapsed summary while a RowStatusCluster-style ... marker doesn't"). This is the card's own expand/collapse, not a separate reveal-on-click built for the cluster, and it composes with density as an AND: a header cluster needs both Advanced tier and an expanded card. A row with neither renders no cluster at all (RowStatusCluster returns null). Confidence renders as plain, non-interactive text ("{confidence} confidence", no further suffix) with a title + aria-describedby tooltip carrying the full validationRequired detail: never itself a click target. Evidence renders as the cluster's one real click target: a button whose visible text is just the evidence label (e.g. "SQL plan") but whose accessible name always carries the "Evidence: ..." prefix via an explicit aria-label, regardless of what else sits nearby. Clicking it calls a route to the ledger row (routeTo with an evidence target). RowStatusCluster's fixed slot is the row's own stage-pill/title line (justify-between, cluster right-aligned), the same position in every adopting widget, not floating with the row's detail below. Lists longer than VISIBLE_LIMIT (6, src/view/visible-limit.ts) get page-based navigation (Previous/Next, usePagedRows/RowPagination, src/view/usePagedRows.ts/src/view/RowPagination.tsx) instead of rendering unconditionally: the one sanctioned cap mechanism across every Tier B widget. The shell owns it. It passes the routed finding's position in the list (the route index) to the pager, so a deep-linked route to a finding beyond the first page opens that page and focuses the row. A new file or a new sort order starts the list on its first page.

The following widgets carry a RowStatusCluster, all Advanced-only: Spill.tsx (confidence only), ConfigAudit.tsx's widget-header control (evidence only, a widget-wide constant rather than per-finding data, since the evidence key doesn't vary per row; also the control shown in the widget's empty-findings/no-data states), MemoryUtilization.tsx's widget header (confidence + evidence, one marker, since executorMetrics is widget-wide; ExecutorUtilization.tsx's rows carry neither), each of the Plan Advisor widgets' (one per family: 'plan' finding type, set in its packages/core/src/detectors/<type>/presentation.ts) widget header (confidence + sqlPlan evidence, one marker per widget since each is its own finding type; no per-row control), ScalingSim.tsx (two call sites, evidence only), CoreUsageArea.tsx, EfficiencyModel.tsx and PlanView.tsx (three call sites) (these last confidence-only; all standalone rather than per-finding-row: a card-header badge, a widget-level single marker, a plan-tree node/summary-row marker, or an "unavailable data" message: the same component, same visual language, regardless of where it sits); and, because skew/straggler/gc disclose their own unvalidated noise-floor thresholds (confidence only, per-row, no evidenceKey passed), GcPressure.tsx's rows, Straggler.tsx's rows, CachingOpportunity.tsx's rows (the cachingOpportunity detector scales confidence per finding via cachingReuseConfidence, so the badge sits next to each row rather than as a single caveat below the table), and the shared StageGroup.tsx row (adopted by Skew.tsx/StageShape.tsx/TinyTask.tsx, though only skew findings carry a confidence field).

One named exception:

  • Skew.tsx/StageShape.tsx/TinyTask.tsx: their per-row histogram toggle (ExpandToggleButton + useExpandableRow) gates a lazily-fetched duration histogram, unrelated to confidence/evidence. It sits alongside RowStatusCluster in the shared StageGroup.tsx row; the two controls coexist per row. ExpandToggleButton is single-purpose (always the task-detail toggle) since these three are its only adopters.

No toggle at all, unconditional content, since these widgets carry no confidence/evidence display: IncompleteRun.tsx, ShuffleIO.tsx, PartitionSizing.tsx, StageFailed.tsx, TaskFailures.tsx, RetryWaste.tsx, ColdStart.tsx, SlowHost.tsx, StageSlowness.tsx, SpeculationWaste.tsx, ExecutorCountChart.tsx, ExecutorUtilization.tsx, RightSizing.tsx, JobFailures.tsx, CacheUtilization.tsx and AutoscalingChurn.tsx.

Three named exceptions to specific pieces of the contract, not to the row wrapper or pagination, which still apply to all three:

  • CoreUsageArea.tsx's non-local-stage list is a derived stat breakdown (computeCoreLocalityRatio's topStages), not a Finding[]: there is no per-row finding or recommendation to reveal. Paginated like every other Tier B list, but with no per-row expand.
  • CacheUtilization.tsx's RDD <Table> holds reference columns (name, storage level, partitions, memory, disk bytes) with no recommendation attached to any row. Paginated like every other Tier B list, but with no per-row expand. Its separate finding list below the table is full Tier B (unconditional, no toggle, per the paragraph above).
  • IncompleteRun.tsx leads with no metric of its own: this app-scoped, single-finding widget has no natural lead figure distinct from its title/badge, unlike every other Gold Standard widget, which leads with a percentage, duration, or count.

In-place evidence panel ​

A widget opened from a verdict step or a Findings row renders inside InlineEvidence (src/view/InlineEvidence.tsx), which provides InlineEvidenceContext (src/view/InlineEvidenceContext.ts). The widget is mounted with defaultCollapsed={false}, and WidgetCard reads the context. Every step and every row has its own panel, scoped to its findings (scope): the widget receives the catalog without its other findings of the same type, so each finding's evidence sits under its own line. The panel registers as a route target with holds, the findings a route may open it for (see "First investigation routing" in investigation-routing).

  • The card renders as a flat panel, not a card: a left rule in the stated finding's impact color (IMPACT_BORDER_CLASS; the context's band, or the widget's own band under a group row), the card's heading, no border, no chevron and no collapsed summary. "Hide evidence" on the row is the only control. The heading stays an h3 and is the route focus target.
  • TagBadge renders nothing, and WidgetCard leaves out its fixFor sentence: the line above carries the tag and the fix.
  • The line above states one finding per step (its lead) or per single-finding row; a group row states none. The context lists those findings' ids, and the shell passes them to rows as stated. A row records whether its finding is stated (isStated), as data, and renders from that. A stated finding's row leaves out the stage chip (StageHeader's stated keeps the stage name), the savings (ImpactEstimate renders nothing), and any figure the finding's sentence repeats. It keeps whatever the line lacks: call sites, breakdowns, hints, charts, the status marker. A finding the line does not state keeps all its facts, so one panel can hold both kinds.
  • A panel always shows evidence the line does not state. A widget whose row is only the stated figure shows the measurements behind it instead: Executor Utilization shows the core-time breakdown and the core usage chart, Memory Utilization the chart, the heap peak or the allocated memory-time, Excessive Small Files the average file size, Stragglers the straggling task count and the stage's task duration spread with its histogram, Slow Executor Host the deviating executor's measured amount, Nested Loop Join the join node, type, condition and input rows, MERGE Rewrite the unmodified and changed row counts with the file and partition counts (a row names its query and target, and merges commands with identical counts). A panel leaves out a core usage chart with fewer than 3 points. Never drop a row's own evidence to avoid a repeat; tests/view/evidence-panels-not-empty.test.tsx opens every "Show evidence" button on the sample run and the public fixtures, in the default view and with info shown, and fails on a panel with nothing under its heading besides its stage chip, stage name and call site (data-panel-identity).
  • A step or row whose widget has nothing to show beyond the line above offers no evidence control and no panel. The decision is data, never a render. Every REGISTRY entry has a model (FindingWidgetModel, src/view/finding-widget.tsx) whose rows function (RowsOf, src/view/evidence-panel.ts) takes the findings, the stated ids, the density and the appModel and returns the rows the widget shows; a missing model is a compile error. The model lives in <Widget>.rows.ts beside the lazy-loaded widget (RetryWaste.rows.ts, RightSizing.rows.ts, StageSlowness.rows.ts). evidencePanelFor (detector-registry.tsx) runs the same rows and turns the result into an EvidencePanel, a branded value that is null when there is no row. The verdict step, the Findings row and the group row take the panel from buildBoardLayout (board-layout.ts, evidencePanelOf), which follows the density; the evidence control, the panel row and InlineEvidence accept only that value, and the shell renders only the rows rows gives, so the panel and the widget are one decision. A route to a finding with no panel still lands: the layout marks the step or row as bare, and the route scrolls to it and focuses its title or label (useLine). tests/view/evidence-panel-types.test.ts holds the @ts-expect-error cases. Three behaviour tests hold the decision to the data, whatever way a change observes the output: tests/view/evidence-check.test.tsx renders every panel the rows give for every finding of every example run, in both densities, with and without the finding stated above, and fails on one that shows nothing under its title (hidden output counts as not shown), and checks that a row offers its evidence control exactly when its widget has a row; tests/view/closed-evidence-panels.test.tsx renders the dashboard with every panel closed and fails when a widget renders under a verdict step or a Findings row; tests/view/route-focus.test.tsx routes to each example finding and fails unless the focused element is visible and in that finding's row, panel or card. The ast-grep rules in rules/ ban the observe-and-correct shapes in view code (see Structure rules). Where a step, a row or a card shows a finding is evidencePlacement (see Evidence placement).

None of this applies in the grid, the Full app report or the stage dialog, where the context is absent and every widget renders in full.