Skip to content

Remove Copy as Image; better text copy and selection (line numbers, blame label, bottom-to-top drags) - #8

Merged
jkyberneees merged 9 commits into
mainfrom
loop/feature-20261029-1658-text-selection
Oct 29, 2026
Merged

jkyberneees merged 9 commits into
mainfrom
loop/feature-20261029-1658-text-selection

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Remove Copy as Image (back to the 1.5.0 code); better text copy and selection

Copy as Image (shipped in 1.6.0) did not work reliably in the macOS app, so this PR removes it and returns to the 1.5.0 code. The tree matches v1.5.0 except the version, which stays 1.6.0 so the next release is still an update. It then improves plain-text copy and selection in the code view.

What

  • Revert (a68c4ae): Copy as Image, its palette command, shortcut, context menu, canvas/SVG rendering and the macOS pasteboard handlers are gone.
  • Copy is the file's text. ⌘C / Ctrl+C, and the WebView's own Copy, copy the selection from the file model. That includes parts scrolled outside the rendered window, with exact newlines and tabs, and never line numbers, blame text or the "… N more characters" label.
  • Selections survive scrolling. The code view keeps the selection as a model range and restores it after virtualized re-renders, preserving its direction, so a bottom-to-top selection stays anchored at the bottom. A selection made elsewhere drops the stale range; a plain click clears it.
  • ⌘A / Ctrl+A with focus in the code view selects the whole file. The explorer, palette, find bar, inputs and the terminal keep their native behaviour, and hidden or closed views never take it over.
  • Line numbers never join a selection. WebKit (the macOS app) ignored the unprefixed user-select: none, so every rule now also has -webkit-user-select: none, and the gutter, blame and truncation labels get a transparent ::selection backstop.
  • The git blame label no longer gets in the way. Pressing to start a drag used to re-render every row, twice, once for the active line and once when the blame arrived, which tore out the drag's anchor. That is why bottom-to-top selection was hard. The active line and the blame label are now patched in place, the label stays hidden while the button is held and while text is selected, and it appears after release.
  • Views are disposed when tabs close or are rebuilt, so no document listeners leak.
  • README: a short Selection note.

How to test

  1. Open a tracked file, press on a lower line and drag up. The selection holds, no blame label appears mid-drag, and the label shows after you release and clear the selection.
  2. Drag across lines: the line numbers never highlight.
  3. Select far past the screen, scroll away and back. The selection is still there, and ⌘C copies all of it without line numbers.
  4. ⌘A in the code view selects the whole file. In the explorer, palette and terminal, ⌘A and ⌘C behave as before.

Known minor behaviour

  • The blame label is position: sticky, so it adds a little horizontal scroll width at the end of the active line.
  • If a selection collapses without a click (e.g. arrow keys), the label stays hidden until the next click.

🤖 Generated with Claude Code

jkyberneees and others added 9 commits October 29, 2026 16:57
Copy as Image did not work reliably in the macOS app. This restores the
tree of v1.5.0 (keeping the 1.6.0 version so the next release is still an
update). Text selection and copy improvements follow on top of this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…copy and select-all with focus or selection inside
@jkyberneees
jkyberneees merged commit 2c598c5 into main Oct 29, 2026
4 of 5 checks passed
Sign up for free to 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