fix(panes): keep text selectable outside seam drags; render JSON monospace - #170
Merged
Merged
Conversation
…space - SplitPane applied select-none to the converter shell unconditionally, killing mouse selection in every pane (CSV table, JSON editor, read-only output, raw text). It now applies only while a seam drag is live and is removed on pointerup. - Added a --font-mono theme token and applied it to the shared JsonCodeMirror host so the JSON editor and read-only output render fixed-width in both themes (CSV numerics already used font-mono).
Contributor
Author
There was a problem hiding this comment.
Obvious Code Review — Pass 1
Verdict: COMMENT
No findings — clean pass.
Reviewed the full canonical patch at head f772886:
- Drag-scoped
select-noneinSplitPane: listeners attach/detach symmetrically withdragging,pointercancelhandled, pointer capture keepspointerupon the seam; keyboard resize correctly never suppresses selection. --font-monotoken propagates into CodeMirror via the theme'sfontFamily: inherit(verified in the rebuilt bundle); font stack covers macOS/Windows/Linux.- Dist freshness satisfied: new asset hashes referenced consistently, old assets deleted, prerendered shell updated.
- Gates re-run locally on the PR head:
tsc --noEmitclean, vitest 97/97 passing.
Contributor
Author
|
Thanks for the clean pass — glad the drag-scoped select-none, token propagation, and dist freshness all check out at head f772886. |
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.
Why
David, using the live app, reported he could not select any text in the converter — not the JSON, the CSV table, or the raw text view — and that the JSON output was not fixed-width. Both trace to the converter shell:
SplitPanecarriedselect-noneunconditionally (meant to guard seam drags, but applied as a standing rule), and the CodeMirror renderer inherited the sans body font because nothing applied the monospace token to it.What
select-noneon theSplitPanecontainer is now conditional on the existingdraggingstate — it applies only while a seam drag is live and is removed onpointerup/pointercancel. Idle text is fully selectable with the mouse in the CSV table, JSON editor, read-only output, and raw-text view; keyboard selection (shift+arrows, ctrl/cmd+A) is unaffected.--font-monotoken in the Tailwind theme (app/src/index.css,@theme inline) and appliedfont-monoto the sharedJsonCodeMirrorhost — the single renderer behind both the editable JSON pane and the read-only output view. The CodeMirror content already inherits, so both panes now renderui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospacein both themes. CSV numerics already usedfont-mono, which now resolves to the same token.Rejected alternative: suppressing selection at the document level during drag — the container-scoped class is tighter and self-cleaning.
How to Review
app/src/components/SplitPane.tsx— the one-line behavioral change plus comment.app/src/components/JsonCodeMirror.tsx+app/src/index.css— token definition and its single consumption point.SplitPane.test.tsxasserts the shell is selectable while idle andselect-noneonly during a live drag;JsonCodeMirror.test.tsxasserts both editor and output hosts carry thefont-monotoken.Test Evidence
97/97 vitest, eslint and tsc clean. Verified in the built app (vite preview + Playwright, light and dark): computed
user-selectisautoon table cells, JSON editor, and read-only output while idle;noneon the shell only during a live seam drag and restored after pointerup; computed font-family on editor and output content is the monospace token stack in both themes; a real mouse drag-select captured 32 chars of JSON output text. dist rebuilt and committed per the freshness gate.🔗 Obvious Project · 🧵 Obvious Thread