-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
File preview modal freezes when rendering large code files in Skill Workshop #99062
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Problem
When viewing generated skills in the Skill Workshop, opening the "Support files" preview modal causes severe page lag and freezing, especially when the proposal includes large code files (up to 256 KB per file).
Root Cause
In
ui/src/ui/components/file-preview-modal.ts, the entire file content is rendered as a single giant<pre>text node:For a 256 KB file with ~5000 lines, the browser must layout and paint the entire content as one monolithic DOM node. When scrolling through the code, the browser struggles to repaint such a large text node, causing visible stutter and freezing.
All support file contents are also eagerly loaded into memory at inspect time via the
skills.proposals.inspectRPC, and passed to the modal component as a single array property.Steps to Reproduce
/skills/workshop)Expected Behavior
Scrolling through code files should be smooth regardless of file size. Only the lines visible in the viewport (plus a small buffer) should be rendered.
Suggested Fix
Implement virtual scrolling for the code viewer — render only the visible lines plus overscan buffer, using spacer elements to maintain correct scrollbar dimensions. The same approach used by code editors and large-list UIs.
Environment
ui/src/ui/components/file-preview-modal.ts