fix: don't copy line numbers when copying a section of the log - #98
Merged
Merged
Conversation
Copying a selected section (via "Copy Selection" / getSelection().toString())
was including the gutter line numbers. `user-select: none` stops the mouse from
highlighting them but does NOT keep them out of Selection.toString(), so they
leaked into the clipboard.
Render the line number as CSS-generated content instead of a real text node:
each `.line-number` now carries the value in a `data-lineno` attribute and shows
it via `.line-number::after { content: attr(data-lineno) }`. Generated content
is never part of the selection, so copying a section yields the log text only —
no line numbers — across every render path (main, virtualized, diff, DOM-built).
Uses ::after so it doesn't collide with the diff view's ::before +/-/~ gutter
markers. Also added the -webkit-user-select prefix on the gutter. Nothing reads
the gutter's textContent, so no logic changes.
tsc 0 · 667 tests green · bundle built.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ozgesolidkey
added a commit
that referenced
this pull request
Aug 19, 2026
fix: don't copy line numbers when copying a section of the log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Copying a selected section of the log included the gutter line numbers in the clipboard.
user-select: noneon.line-numberstops the mouse from highlighting them but does not keep them out ofgetSelection().toString()(what "Copy Selection" uses), so they leaked in.Fix
Render the line number as CSS-generated content instead of a real text node — each
.line-numbercarries the value in adata-linenoattribute and shows it via.line-number::after { content: attr(data-lineno) }. Generated content is never part of a selection, so copying a section now yields the log text only, across every render path (main, virtualized, diff, DOM-built).Uses
::afterso it doesn't collide with the diff view's existing::before+/-/~ gutter markers. Nothing reads the gutter'stextContent, so no logic changes.Verify
tsc 0 · 667 tests green · bundle built. GUI eyeball: line numbers still show correctly (incl. diff view markers), and selecting a section + copy → paste yields text with no line numbers.
🤖 Generated with Claude Code