fix(tui): drop the input box side borders so drag-select copies text alone - #2882
Open
puncsky wants to merge 1 commit into
Open
fix(tui): drop the input box side borders so drag-select copies text alone#2882puncsky wants to merge 1 commit into
puncsky wants to merge 1 commit into
Conversation
…alone The composer drew a full box: rounded corners plus a vertical bar on the outer column of every content row. Dragging to select the text pulled those bars into the clipboard, and the padded row width added trailing spaces on top. - Repaint the top/bottom border rows as edge-to-edge horizontal rules (the two columns that carried the corners are rule now) and leave content rows untouched, so no vertical bars are drawn at all. - Move the `>` / `!` prompt token to column 0 (paddingX 4 -> 2) and trim the mirrored right-hand padding at render time; a copied row is then exactly the typed text. Rules and the inverse-video caret end in an SGR reset, so the trim never eats into them. - Give the /btw panel the same treatment, since it docks onto the composer: full-width rule on top, body indented to the editor's text column, no padding to the right. - Remove `connectedAbove` / `borderHighlighted`, which only existed to pick the connector corners that no longer get drawn. The bash-mode label keeps one leading dash so the top rule still reads as a rule, and the shell-mode / plan-mode border colours are unchanged.
🦋 Changeset detectedLatest commit: c6489a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
puncsky
marked this pull request as ready for review
August 13, 2026 06:55
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.
Related Issue
No existing issue covers this — see the Problem section below. The closest one is #2095, which is about the caret being included in a mouse selection; that is a different glyph and is not fixed here.
Problem
The input box was drawn as a full box: rounded corners plus a
│in the outer column of every content row. Dragging to select the text with the mouse pulls those bars into the clipboard, so pasting the copy elsewhere gives something likeinstead of the typed line. Content rows were also padded out to the full width, so the copy carried trailing spaces past the text.
What changed
The composer is now delimited by two edge-to-edge horizontal rules instead of a box, and nothing but text lives on the content rows.
paintHorizontalRules(waswrapWithSideBorders) repaints the top/bottom border rows across every column — including the two that used to carry╭╮╰╯— and returns content rows untouched, so no vertical bars are drawn at all. Scroll indicators (── ↑ N more ──) keep working as rules.>/!prompt token moves to column 0 (paddingX4 → 2, now the singleEDITOR_PADDING_Xconstant thatinjectArgumentHintshares) and the mirrored right-hand padding is trimmed at render time. A copied row is then exactly the typed text: no leading gap, no trailing spaces. Rules and pi-tui's inverse-video caret both end in an SGR reset, so the trim can only ever eat unstyled padding./btwpanel gets the same treatment since it docks onto the composer: full-width rule on top, body indented to the editor's text column, no padding on the right, height-holding rows collapse to empty strings.connectedAbove/borderHighlightedare gone — they existed only to choose the├ ┤connector corners, which are no longer drawn.The bash-mode label keeps one leading dash (
─ ! shell mode ───…) so the top row still reads as a rule rather than an indented caption, and the shell-mode / plan-mode / slash-context border colours are unchanged.Before / after (
¶marks the end of each rendered row):Known trade-off: pi-tui's
paddingXis symmetric, so the right-hand 2 columns are still reserved for padding and text wraps 2 columns earlier than the rule ends. It is invisible (the spaces are trimmed), but on a very narrow terminal it costs 2 columns of usable width. Making it truly asymmetric means changing the padding contract inpackages/pi-tui, which felt out of scope for this fix — happy to follow up if you would rather have that.Tests:
paintHorizontalRulesgets its own suite (rule width, no corner/bar glyphs, content passthrough, SGR repaint, label overlay and its overflow fallback, scroll-indicator rows),CustomEditorgains full-render assertions (no│anywhere, top/bottom rows are exactly'─'.repeat(width), prompt flush at column 0 in both prompt and bash mode, no trailing padding on any row), andprompt-symbolis rewritten for the new geometry.test/tuipasses at 139 files / 1962 tests, plustsc --noEmitandoxlint --type-awareon the touched files.The normative TUI design spec (
.agents/skills/write-tui/DESIGN.md) is updated so the composer style is recorded next to the existing list/selector rule; dialog input boxes keep their rounded boxes.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. (The docs describe the input box in prose only — no rendered box art — and the shell-mode wording "the border turns violet" still holds.)