Repository navigation
Findings: the evidence pane and the assessment parts split by concern - #1799
Conversation
The pane keeps its component, state, reveal logic and layout. The navigation context, the shared card parts, the sixteen body renderers in six families, the pure partition helpers, the card and the coverage and collection sections each live in their own module, with imports running one way: pane, sections, card, bodies, card parts, context and types. Nothing changes shape; every declaration moved with its comment.
Agent controls and consent, the Activity turn and timeline, the Apply dialog, the assessment cards with their next steps, the pure copy text and the shared markdown and copy button each live in their own module. parts.tsx re-exports the same public names, so its consumers do not change; no internal module imports the barrel. prettyTool moves down into the label module it belongs with.
The pane already resolves the story once for its own counts; the story takes that result as a prop instead of resolving it again.
The label's rule lived in a closure inside the view; it is now a pure function in the label module, pinned by tests for the call in flight, the quiet seconds after one finishes, the flip to Thinking, and the counters.
PR Summary by QodoSplit findings evidence and assessment UI by concern
AI Description
Diagram
High-Level Assessment
Files changed (34)
|
Code Review by Qodo
1. Status panels ignore theme backgrounds
|
Summary
The Findings pane and its assessment parts are split by concern. Nothing changes for a reader: the same cards, folds, chips and steps render from the same record. What changes is where the code lives, so a card change is a change to one file rather than to a 4,000-line pane, and the two files that every future evidence feature touches (the card and its bodies) now have one owner each.
What changed
The evidence pane, one module per concern
InvestigationEvidencePane.tsxkeeps the component: its state, the reveal logic and the layout. Everything else moved with its comments, and imports run one way: pane â sections â card â bodies â card parts â context and types.investigationEvidence/navigation.tsxEvidenceNavigationContext(same object, so provider identity is preserved) andInvestigationTimelineScopeinvestigationEvidence/cardParts.tsxSourceButton,EvidenceIcon,EvidenceCaveat,ResourceFact,OpenResourceButton,OpenTimelineButton,EvidenceDataOf, the severity and phase helpersinvestigationEvidence/bodies/workload(issue, startup, crash, resource with GitOps status and scaled-by),streams(logs, events, changes),network(dns, network, relationships, topology),inventory(withInventoryRowandnamedInventoryRows),metrics(metrics, alerts),platform(helm, permissions);index.tsxholdsEvidenceBodyandevidenceHasDetailsinvestigationEvidencePartition.tspartitionInvestigationEvidenceand the six pure helpers beside itEvidenceCard.tsxRevisionHistoryInvestigationEvidenceSections.tsxCoverageStrip,CoverageGroupRow,CollapsedEvidenceCollection,EmptyCollection,RuledOutBlock,AssessmentEvidenceQualificationparts.tsx, split behind an explicit barrelAgentControls.tsxActivityTurn.tsxTurnView,Timeline,ToolRow,ToolResultDialog, the startup and thinking helpers, the label helpersApplyDialog.tsxApplyDialog,ApplyOutcomeCardAssessmentCard.tsxResultCard,DiagnosisResultwith its next steps,AllClearCard,InconclusiveCard,AssessmentHeadline,AssessmentSources, the remediation helpersassessmentCopy.tsassessmentCopyTextand the labels it shares with the cards (pure)AIMarkdown.tsxAIMarkdown,CopyButtontoolCallLabel.tsprettyTool, moved down so the label module imports nothing from the UIparts.tsxre-exports the same public names, so its twelve importers are unchanged; no internal module imports the barrel.Two small shape changes, each its own commit
AnalysisStorytakesplacementsas a prop. The pane already resolves the story once for its own counts; the story no longer resolves it again.investigationRunningLabelintoolCallLabel.ts, a pure function with tests for the call in flight, the quiet seconds after one finishes, the flip to Thinking, and the counters. The view calls it.Left for later, deliberately
Splitting
InvestigationView(2,400 lines, 29 hooks) needs a state-ownership plan and interaction coverage first. The excerpt slot and thefocuscontract belong to the next feature PR, where their behaviour is defined.Testing
make tsc;cd web && npm test(113 files, 1338 tests);cd packages/k8s-ui && npm test(3771);npm run lint(0 errors);git diff --check.exportkeyword and prettier's reflow. One regex quantifier mangled by an import cleanup was caught this way and restored before the commit.partsbarrel.Note
Low Risk
Refactor with preserved exports and broad test coverage; main risk is accidental import/barrel cycles or a missed re-export, not production logic changes.
Overview
Structural refactor of the diagnose Findings surface: large blocks move out of monolithic pane/
partsfiles into focused modules. User-visible behavior is intended unchanged; imports and ownership change so card, body, and assessment work land in smaller files.The evidence pane keeps
InvestigationEvidencePaneas the shell; partitioning, navigation context, card chrome,EvidenceCard, section layouts, and six body families (workload,streams,network,inventory,metrics,platform) live in dedicated paths underinvestigationEvidence/. Tests follow the new import locations (e.g.VISIBLE_LOG_EVIDENCE_LINES,namedInventoryRows,partitionInvestigationEvidence).Assessment and activity UI split from
partsintoAgentControls,ActivityTurn(turns, timeline, tool rows, dialogs),ApplyDialog,AssessmentCard, plusAIMarkdown/CopyButton(clipboard UX, fence normalization, softer inline code) andassessmentCopy/toolCallLabel.partsstill re-exports the same public names so existing./partsimporters stay stable.AnalysisStorynow accepts pre-resolvedplacements(StoryPlacements) instead ofreport+resolveItem, so hosts resolve once for counts and rendering; tests passresolveStoryPlacements(...)explicitly.Minor formatting-only diffs in a few test/surface files;
DiagnoseSurfaceimport line-wrap only in the shown diff.Reviewed by Cursor Bugbot for commit 8c8af11. Bugbot is set up for automated code reviews on this repo. Configure here.