Skip to content

refactor: decompose ClinicalDashboard — answer-content + evidence-panels (move-only) - #211

Merged
BigSimmo merged 4 commits into
mainfrom
claude/kind-visvesvaraya-beb836
Jul 2, 2026
Merged

refactor: decompose ClinicalDashboard — answer-content + evidence-panels (move-only)#211
BigSimmo merged 4 commits into
mainfrom
claude/kind-visvesvaraya-beb836

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

What

Continues the move-only decomposition of src/components/ClinicalDashboard.tsx (AuthPanel already landed via #202). Extracts the next two modules; the monolith shrinks from ~8.8k to ~6.1k lines.

answer-content.tsxSourceImage, ScopeAndGovernanceNotice, the answer/source formatters, SourcePreviewContent, NaturalLanguageAnswer, UserQuestionBubble, KeyClinicalItems. Two shared helpers went to clean homes (not a cycle): useMobilePreviewSheet → new use-mobile-preview-sheet.ts, comparableAnswerTextdisplay-text.ts.

evidence-panels.tsx — the clinical-detail/notes helper family + AnswerSupportSummaryCard, ClinicalNotesChecklistPanel, SafetyFindingsPanel, EvidenceGapPanel, EvidenceCounts, AnswerSourceStatus, EvidenceSummaryCard, AnswerInsightBar, EvidenceVerificationStrip, AnswerFeedbackPanel, RenderModelSourceList, VerificationWorkspace, AnswerViewModeControl, EvidenceMapTable, AnswerSafetyNotice, QuoteCards (contiguous block, moved verbatim).

evidence-panels needs a monolith to module cycle: ClinicalNotesChecklistPanel renders ClinicalOutputPanel, which stays in the monolith as the deferred output-panel (B3). So it imports ClinicalOutputPanel + clinicalQueryModeOptions + type AnswerFeedbackType back from @/components/ClinicalDashboard — the same pattern global-mockup-search-shell.tsx already uses for SettingsDialog. No import/no-cycle rule; all cyclic refs are render-time so init is safe (ui-smoke is the definitive check). The monolith imports 26 symbols back, including the detail-helper family output-panel will consume.

Move fidelity

  • Each block cut verbatim — original source ranges diff empty against the new module bodies.
  • data-testid / aria-label sha1 checksum over ClinicalDashboard.tsx + clinical-dashboard/*.tsx is byte-identical to main.
  • Stripped only imports the moves orphaned; two pre-existing dead imports left untouched.

Pinned guards — retargeted, not weakened

  • clinical-dashboard-merge-artifacts.test.ts: scans a scannedFiles array; NaturalLanguageAnswer pin in answer-content, ClinicalOutputPanel still in the monolith, absence checks cover all files.
  • rendered-text-formatting.test.ts: scans monolith + answer-content + evidence-panels corpus; verified modules trip none of the raw-render negative regexes.

Gates

typecheck; lint 0 errors; pinned vitest 12/12; testid/aria checksum identical; format:check; verify:cheap 906/906.

Deferred (hand-off in docs/process-hardening.md Phase 3)

output-panel.tsx (AST-pinned ClinicalOutputPanel; repoint evidence-panels' back-import when it moves), then visual-evidence.tsx, document-results.tsx.

🤖 Generated with Claude Code

BigSimmoand others added 4 commits July 3, 2026 01:56
…nolith
Move-only extraction of the answer render family (SourceImage,
ScopeAndGovernanceNotice, the answer/source formatters, SourcePreviewContent,
NaturalLanguageAnswer, UserQuestionBubble, KeyClinicalItems) into
clinical-dashboard/answer-content.tsx. Block moved verbatim — the original
510-1249 range diffs empty against the new module body, and the
data-testid/aria-label sha1 checksum over ClinicalDashboard.tsx +
clinical-dashboard/*.tsx is byte-identical before/after.
Two monolith-internal helpers used by both the moved block and the code that
stays behind went to clean shared homes instead of a monolith<->module import
cycle:
- useMobilePreviewSheet (+ its media-query snapshot helpers) ->
clinical-dashboard/use-mobile-preview-sheet.ts (matches use-theme.ts pattern)
- comparableAnswerText -> clinical-dashboard/display-text.ts
Retargeted the pinned guards without weakening them: the NaturalLanguageAnswer
AST pin now scans answer-content.tsx (via a scannedFiles array), and the
rendered-text-formatting negative regexes now scan the monolith+module corpus
(verified the module trips none). Stripped the imports the move orphaned;
pre-existing dead-code warnings left untouched (move-only).
Gates: typecheck, lint (0 errors), pinned vitest 12/12, testid/aria checksum
identical, format:check, verify:cheap (903/906; the one failure is an
unrelated rag-cache timeout that passes in isolation).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…onolith
Move-only extraction of the answer-evidence family (the clinical-detail/notes
helper family plus AnswerSupportSummaryCard, ClinicalNotesChecklistPanel,
SafetyFindingsPanel, EvidenceGapPanel, EvidenceCounts, AnswerSourceStatus,
EvidenceSummaryCard, AnswerInsightBar, EvidenceVerificationStrip,
AnswerFeedbackPanel, RenderModelSourceList, VerificationWorkspace,
AnswerViewModeControl, EvidenceMapTable, AnswerSafetyNotice, QuoteCards) into
clinical-dashboard/evidence-panels.tsx. Contiguous block 484-2311 moved
verbatim — it diffs empty against the new module body, and the
data-testid/aria-label sha1 checksum over ClinicalDashboard.tsx +
clinical-dashboard/*.tsx is byte-identical. Monolith 7909 -> 6084 lines.
This module needs a monolith<->module cycle: ClinicalNotesChecklistPanel
renders <ClinicalOutputPanel/>, which stays in the monolith as the deferred B3
(output-panel) module. So evidence-panels imports ClinicalOutputPanel,
clinicalQueryModeOptions, and type AnswerFeedbackType back from
@/components/ClinicalDashboard - the same back-import pattern
global-mockup-search-shell.tsx already uses for SettingsDialog. The repo has no
import/no-cycle rule and every cyclic reference is render/runtime-time, so
module init is safe (ui-smoke is the definitive build-time cycle check). The
monolith imports 26 symbols back, including the exported clinical-detail helper
family that output-panel will consume when it lands next.
Widened rendered-text-formatting.test.ts to scan the monolith + answer-content +
evidence-panels corpus (QuoteCards/EvidenceMapTable/source-snippet render
surfaces moved into evidence-panels); verified the module trips none of the
raw-render negative regexes. Stripped the imports the move orphaned; the two
pre-existing dead imports (clinicalNotesRow, evidenceRow) are left untouched.
Gates: typecheck, lint (0 errors), pinned vitest 12/12, testid/aria checksum
identical, format:check, verify:cheap 906/906.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BigSimmo
BigSimmo enabled auto-merge (squash) July 2, 2026 19:00
@BigSimmo
BigSimmo merged commit a91962d into mainJul 2, 2026
4 checks passed
BigSimmo pushed a commit that referenced this pull request Aug 14, 2026
Queues six immutable inbox requests for the work in this PR. Ordinary
branches never edit the canonical ledger, so these reconcile after it lands.
- done #313: the dirty-tree refusal shipped. Records the two traps only
running it surfaced (the trimmed porcelain that silently disabled the
guard, and guard-push's explicit --head), and notes the row's related
outstanding-issues.mjs vs issues:done confusion is NOT addressed.
- update #211: the plan exists, the migration does not, so the row stays
open and stays deprioritised. Carries the 2026-08-12 deprioritisation
conclusion forward and corrects the count it rested on — 1,445 across 269
files, not 1,266.
- cancel 0e47904b: superseded by that update, which is a strict superset of
it. Two pending updates on one row force a cancellation decision at
reconcile regardless, so this makes the decision explicit rather than
leaving it for whoever reconciles.
- update #168 and #258: design and gap documentation landed; neither row is
closed, because neither asked only for a document. #258's update records
that its cheapest-first option is currently unavailable — checked against
all three manifests, not assumed.
- add: one new P2 recommendation. Two merge-loss detectors now exist and
measure different things — this PR's catches a landing whose content was
reverted, PR #1937's concerns a file that never landed at all — and
neither covers the other's case. Also carries the undecided scheduling
question this PR deliberately left open.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Chrn9bTYFFYzrLZqtpVptW
BigSimmo pushed a commit that referenced this pull request Aug 14, 2026
Applies the pending inbox to docs/outstanding-issues.md as one serial
transaction from a fresh origin/main base (0011a05), which is the only
path allowed to edit the canonical ledger.
35 requests: 17 done, 7 add, 6 update, 5 cancel. Every request moves
verbatim to docs/outstanding-issues-inbox/applied/ as its immutable audit
record. One row carried competing mutations — #213, two done requests —
resolved by the cancel already queued against one of them.
Ledger goes from 328 to 334 rows, 115 open to 99.
Includes the five requests queued by PR #1944 but left pending when it
merged: closes#313 (the write-discipline dirty-tree refusal shipped),
carries #211 forward with its re-measured 1,445 errors while keeping the
2026-08-12 deprioritisation judgment, records the documented state of #168
and #258, and opens #335 for the gap between the two merge-loss detectors.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Chrn9bTYFFYzrLZqtpVptW
Sign up for freeto 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.

1 participant

@BigSimmo