Repository navigation
refactor(ui): migrate Markdown presentation to Solid - #169333
Conversation
Keep sanitized Markdown in its framework-neutral DOM owner, retain lazy Mermaid loading, and preserve table dialog focus and clipboard ownership. The Solid ref is ready for the transcript cutover on main.
Use the same DOM owner in Markdown attachment readers, preserve source typography, and scope tooltip feedback assertions to their own live region.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesMoves Markdown presentation to Solid while retaining streaming DOM, table interactions, file tooltips, and lazy Mermaid rendering. Example: A chat reply contains
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it completes the established Solid migration, preserves existing Markdown ownership, and has no actionable introduced defect. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI converts sanitized message and attachment Markdown into retained DOM, then enhances code blocks, tables, file tooltips, and Mermaid diagrams. flowchart TD
A[Messages and attachments] --> B[Markdown sanitization]
B --> C[Solid Markdown ref]
C --> D[Markdown DOM reconciler]
D --> E[Retained DOM]
E --> F[Table and tooltip enhancements]
E --> G[Lazy Solid Mermaid presentation]
Technical reviewBest possible solution: Complete the focused presentation cutover using the existing DOM, clipboard, modal, and renderer owners. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a defect report; source, history, supplied browser captures, and hosted checks were inspected without running target code or tests. Is this the best way to solve the issue? Thin Solid adapters drive existing TypeScript owners, the replaced Mermaid class is removed, and retained Lit adapters have concrete remaining callers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4080d32a8b10. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +70, Tests +76, Other 0. Total +146 across 19 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)Reviewed October 11, 2026, 5:39 PM ET / 21:39 UTC (Revision 4). |
|
Merged via squash.
|
* refactor(ui): migrate Markdown presentation to Solid Keep sanitized Markdown in its framework-neutral DOM owner, retain lazy Mermaid loading, and preserve table dialog focus and clipboard ownership. The Solid ref is ready for the transcript cutover on main. * fix(ui): initialize retained Markdown refs for Solid fragments Use the same DOM owner in Markdown attachment readers, preserve source typography, and scope tooltip feedback assertions to their own live region. * refactor(ui): drive transcript Markdown through the Solid ref * fix(ui): preserve Mermaid source view styling * style(ui): brace the Markdown ref early return * style(ui): brace Mermaid menu action branches
What Problem This Solves
Moves chat Markdown presentation off Lit while preserving retained streaming DOM and existing controls.
User Impact
Code blocks, tables, Mermaid source/copy/expand controls, and table-dialog focus return keep their current behavior. No dependencies, configuration, protocol, or storage changes.
Why This Change Was Made
MarkdownDomReconcilerremains the sole owner of sanitized Markdown DOM. A Solid ref now drives it in transcript rows and Markdown attachment readers. Mermaid uses the Solid bridge under the existing tag and remains behind the original lazy import. Table and tooltip enhancements own plain DOM inside the island. Their small shared SVG adapter uses canonical icon data. Existing unported callers retain their Lit adapters.CI caught missing braces in the ref’s early return and Mermaid menu branches. Both are corrected; focused lint over every changed TypeScript/TSX file passes.
The port also excludes mounted Mermaid source/error views from fence discovery, preventing destructive remounts, and explicitly scopes former shadow styles against surrounding chat styles. The clipboard test now checks its own tooltip live region instead of an unrelated image-copy toast.
Evidence
Base:
939f740219d9fbbd9060acfa483765442bc0a513. Candidate:a84937b65e3d2.Production LOC: 1,744 → 1,814 (+70). The shared ref and DOM icon adapter add 67 lines; scoped source-style resets account for the small remainder while replacing the prior rendering code. Tests: 1,294 → 1,370 (+76); tooling LOC unchanged. Required interim adapters remain because unported callers still use them.
Testbox:
blacksmith-testbox,tbx_01m4p0a3ybvva19kx9gntezfrw, run. The lease completed and was stopped. A subsequent reuse was refused because it had finished; remaining proof ran locally with one worker. CI seconds are reported by this PR's exact-head checks.The unrelated CI test-plan inventory failure was fixed upstream by
ee76fe33a4c77; this branch incorporates it and the exact failing assertion passes locally.The three inherited WebKit keyboard failures are in
markdown-file-tooltip.browser.test.ts: Tab-to-copy and both clipboard-fallback focus cases. The base and candidate show the same failures; the underlying tooltip primitive is unchanged.Visual proof
The attached before/after boards show code, compact tables, Mermaid diagram and source, and the expanded table dialog. Light and dark captures are identical pixel-for-pixel. Screenshots use only the mock Gateway and synthetic content.