Repository navigation
[CPLAT-12912] Pane-scoped drag selection in the session TUI and picker - #179
Merged
Merged
Conversation
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
3bbddc2 |
2026-10-21 03:17 UTC | — | — | — |
3bbddc2 < |
2026-10-21 03:17 UTC | 0 | 0 | 0 |
Last scanned: 3bbddc2 · 2026-10-21 03:17 UTC
Kairo-Kim
approved these changes
Oct 21, 2026
mitrilmad
approved these changes
Oct 21, 2026
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.
JIRA: https://sendbird.atlassian.net/browse/CPLAT-12912
What
Mouse drag now selects text inside the pane under the press, the way the Claude Code mod engine does (fleet convention E14,
github.com/keyolk/tuikit/selectionat c19aa4f). Mouse capture had turned off the terminal's own drag-select, and Shift-drag crossed the divider and both panes.Pane.Lines+YOffset): dragging past the top/bottom scrolls the preview through the same viewport scroll the wheel uses, and the copy keeps the lines that scrolled out.selection.Copy, off the UI thread); the result shows as a footer toast (Copied N chars/Copy failed: ...). The highlight stays until the next press or key.Result.Consumedis false.Panes
ccx pickpicker (internal/cli)While an overlay is open it is the only selectable pane (its rect comes from the existing
overlayRect), so nothing under a modal can be selected. In the picker the ref picker plays that role. A drag inside the picker's search state selects but never edits the term or moves the cursor. Copy mode keeps its own keyboard selection and gets no drag panes.How
internal/tui/drag_selection.go: pane list built from the sameListWidth/PreviewWidth/ContentHeight/conversationLayoutHeight/executionRailTopnumbers the renderers and hit tests use. It holds no geometry of its own.app.go(wiring only): the oldViewbody is nowrenderScreen()(pure, no highlight, no Kitty layer).View=renderScreen+sel.Render+ Kitty layer. The mouse path hit-tests againstrenderScreen()directly instead of caching a frame;overlayRectnow uses it too, so it no longer draws Kitty escapes for its diff.sel.Clear()sits next to themouse.Clicksreset in the top-level KeyMsg arm.dragResizingis set, motion belongs to the resize.termenvbecomes a direct dependency.Tests
Clicks and drags use coordinates found in the rendered
View()output. Copies are asserted on the selection text or on the constructedtea.Cmd; the copy command is never run.Each guarded behavior was checked with a compiling mutation, then restored:
TestDragFromPreviewTowardListStaysInPreview,TestDragPastPreviewBottomScrollsAndKeepsLinesResult.ConsumedTestDragFromListTowardPreviewStaysInList,TestDragPastPreviewBottomScrollsAndKeepsLines,TestPreviewDoubleClickSelectsWordNotEnter,TestConversationPreviewKeepsFoldDoubleClickAndSelectsClearon keyTestKeyClearsSelectionTestOverlayOwnsSelectionTestDragPastPreviewBottomScrollsAndKeepsLinesTestConversationPreviewKeepsFoldDoubleClickAndSelectsTestDragFromListTowardPreviewStaysInList,TestKeyClearsSelection,TestSelectionHighlightSurvivesNoColordragResizingguardTestDragNextToDividerResizesInsteadOfSelectingTestDragInScrolledPreviewCopiesWhatIsShown,TestDragPastPreviewBottomScrollsAndKeepsLinesTestSelectionHighlightSurvivesNoColor/TestPickerHighlightSurvivesNoColorTestPickerDragFromPreviewTowardListStaysInPreview,TestPickerDragPastPreviewBottomScrolls,TestPickerDragSelectsWhileSearchingClearon keyTestPickerKeyClearsSelectionAndNoticeTestPickerRefPickerOwnsSelectionTestPickerDragPastPreviewBottomScrollsTestPickerDragSelectsWhileSearchingConsumedTestPickerDragFromListStopsAtPreview,TestPickerDragPastPreviewBottomScrolls,TestPickerPreviewDoubleClickSelectsWordgofmt -lis clean.go vet ./...passes.go test ./...,go test -race ./..., andenv -u LC_ALL -u LC_CTYPE LANG=ko_KR.UTF-8 go test ./...all pass.Note: the existing
find/wheretest helpers measure with go-runewidth. Under a CJK locale that counts the ambiguous-width divider│as 2 cells, which shifts every column right of it. The split draws the preview at a fixed column (CHA) and the selection measures with x/ansi, so the new tests usefindCell/whereCell(x/ansi). Existing click tests only click left of the divider and are unaffected.