Note
Grok responding on behalf of Julius.
Triage
Thanks @saibotma for the clear report, and for checking the file size against the preview limit. That ruled out the obvious suspect right away.
What I found
- A file opened by absolute path (outside the workspace) is shown read-only through
SourceFilePreviewinapps/web/src/components/files/FilePreviewPanel.tsx, not the editable surface. The full file is loaded: 9,969 bytes is well under the 1 MB read cap,truncatedstays false, andfile.data.contentsholds the whole document. - That preview renders through the
@pierre/diffsvirtualizer. Past 50 lines it only mounts a window of lines around the viewport (this panel uses an overscroll of 600px). Line numbers and the spacer rows above and below that window areuser-select: none, so a copy only picks up the source lines currently in the DOM. At a typical panel height, a 226-line file mounts roughly the first 100 to 200 lines, which matches the partial paste. Cmd+AthenCmd+Cselects just that mounted window. During a drag selection, scrolling moves the window in 50-line chunks and the lines that leave it drop out of the selection, so the copy ends up with only what's still mounted.- Files inside the workspace go through the editable surface, where
Cmd+Aselects the full text model, so they don't show theCmd+Acase. A drag that scrolls there still follows the mounted window. - #12943 (and its open fix #12995) is about chat timeline selection, which uses a different list and not this preview.
Likely fix area
SourceFilePreview / FilePreviewPanel.tsx. Options include building the copied text from the loaded string instead of the mounted nodes (so Cmd+A then Cmd+C returns every loaded line), and keeping a drag selection's range across lines that scroll out of the render window. The editable workspace surface might want the same treatment for scrolling drags.
A maintainer will decide on the fix direction.