Repository navigation
refactor(ui): own file preview state in Solid - #174101
Conversation
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR replaces the HTML preview controller with Solid-owned state and passes editor and search elements through refs. Example: Enter “Retain this page” in report.html’s preview, follow report.html:2, then return to Preview.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 2 items remain Keep this maintainer-authored refactor open; the ownership change is useful, but one introduced preview-retention regression needs repair. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe Control UI detail panel receives selected file content and navigation requests, manages source editing and drafts, and renders HTML through the existing sandboxed preview element. flowchart LR
A[File selection and line links] --> B[Detail panel]
B --> C[Solid preview state]
B --> D[CodeMirror editor]
C --> E[HTML preview element]
E --> F[Sandboxed iframe]
Technical reviewBest possible solution: Keep Solid ownership while resetting source mode on navigation without clearing an existing same-file preview. Do we have a high-confidence way to reproduce the issue? Source inspection establishes navigation → null presentation → preview removal; no target code was executed during this read-only review. Is this the best way to solve the issue? The controller cutover fits the existing Solid direction, but mode selection and retained preview content need separate reset dependencies. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c72336d390c0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -14, Tests +86. Total +72 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 16, 2026, 6:31 AM ET / 10:31 UTC. |
|
Merged via squash.
|
What Problem This Solves
The file sidebar still routed HTML preview state through a Lit-style controller and host invalidation adapter. It now owns preview/source mode with Solid writable derivations, resetting on file or line-navigation changes and preserving retained drafts. The lazy preview loader remains behind its existing boundary.
The panel passes editor/search refs directly and lets the existing menu primitive own outside-click dismissal. File editing remains a synchronous domain operation; CodeMirror still mounts after the DOM commits. Tags, classes, selectors, and appearance are unchanged.
User Impact
No user-visible change. Preview/source mode, retained edits, line navigation, and search focus keep their current behavior.
Evidence
pnpm tsgo:uici:fullrequestedThis is a state/lifecycle refactor with unchanged rendered output and no startup imports. No local build, E2E, or visual capture was run under the campaign's bounded proof policy. Startup bytes were not remeasured because no boot/startup boundary changed.
Touched production metrics
createEffectcreateRenderEffectuntrackaddEventListenerquerySelector(All)?(flush/ owner captureThe checklist's query regex excludes generic calls; all four actual panel DOM queries were removed. The three
untrackcalls deliberately capture lifetime-stable native ref identity. The remaining effect integrates CodeMirror with committed DOM. Test LOC grows by 86 to exercise preview/source mode, file replacement, line navigation, retained edits, and search focus through the real detail-panel element.