Skip to content

Transcript: double-click drags keep selecting whole words - #135

Open
katulevskiy wants to merge 2 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/643
Open

katulevskiy wants to merge 2 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/643

Conversation

@katulevskiy

Copy link
Copy Markdown
Owner

Upstream mirror

Source: zeronsh#643
Original author: @dfrnoch
Original revision: b803b70aeba04ea6c44e8b211105bbd8071544ac

This PR is an isolated Contribution Manager pilot mirror. Its reviews, checks and merge state are separate from upstream. An empty [skip ci] commit suppresses automatic bulk CI; the code tree matches the imported upstream revision.


  • Double-clicking chat text selected the word, but the selection was stored as a normal drag starting at the word's first letter. Any mouse move before release, even slight tremor, re-resolved it letter by letter from there to the pointer. The word collapsed to a few letters and the gesture behaved like a plain drag. Triple-click had the same problem.
  • The selection now remembers it started as a double- or triple-click. While the drag lasts, the pointer end snaps to word boundaries (double-click) or whole text elements, i.e. paragraphs, list items and code lines (triple-click). The clicked unit stays selected in either direction, matching the composer and native text fields.
  • Also applies when the drag auto-scrolls far enough that the starting row leaves the virtualized list.
  • Rendered markdown in the file preview uses the same selection code and gets the fix too.
  • Worth a look: this touches the same render.rs mouse-down listener as open PR Fix transcript selection leaking through popups zeronsh/zeron#556. The overlap is small, only the begin_with_span call sites.

Test plan

  • markdown::render::tests::code_block_lines_participate_in_text_selection now moves the pointer after a double-click. Fails without the fix ("s" instead of "selectable"), passes with it
  • selection::tests::double_click_drag_extends_by_whole_words: tremor keeps the word; dragging forward, backward and into the next element extends by words
  • selection::tests::triple_click_drag_extends_by_whole_elements
  • selection::tests::word_drag_snaps_after_the_anchor_virtualizes
  • cargo test --locked -p zeron-ui --lib -- --test-threads=1
  • cargo clippy -p zeron-ui --all-targets: no new warnings in touched code
  • Manual: double-click a word in an agent reply, then double-click and drag across words and messages

Video preview (This PR vs latest release build)

8mb.video-ci2-LPjtURm7.mp4

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

dfrnoch and others added 2 commits September 30, 2026 01:22
A double click selected the word, but the selection was stored as an
ordinary drag anchored at the word's start. The next mouse move with the
button still down, even a pixel of tremor before release, re-resolved it
as a character range from that anchor to the pointer, so the word
collapsed to a few letters and the gesture behaved like a plain drag.

Record the multi-click unit with the drag. While it lasts, the head snaps
to word (double click) or element (triple click) boundaries and the
anchor unit stays selected in either direction, matching the composer
and native text. The virtualized path snaps the head the same way once
the anchor row scrolls away. Rendered markdown in the file preview uses
the same code and gets the same fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added the review:needs-triage Managed by Contribution Manager label Oct 6, 2026
@contribution-manager-katulevskiy

Copy link
Copy Markdown

Contribution Manager

needs triage · medium risk · untriaged

Open review workspace · Revision 805a8db3

Next actions:

  • Direction decision needed
  • Scope, risk, and platform triage needed
  • Independent code review needed
  • Required check: core-tests (missing)

This summary is maintained by the review app. Decisions and test evidence are recorded in the workspace; the app does not merge PRs.

@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added cm:inbox Contribution Manager: waiting for triage and removed review:needs-triage Managed by Contribution Manager labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cm:inbox Contribution Manager: waiting for triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants