Registry Mirror
Skip to content

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Follow-up to #1955, with the reviewer's three non-blocking points.

1. A selected word no longer turns the fix off. pageSelection used to respect any browser selection on the page. A word double-clicked in a thread message, or a choice's label, selects it, so the next dictated ⌘V was left alone and lost. Now only these keep the paste where it is: a selection inside an attached file's viewer (.ib-view, where it can be commented on), or a selection toolbar showing.

2. sight(): a field clipped out of its pane is off screen. A field scrolled out of its pane but still inside the window used to hit the pane that holds it, and hit.contains(field) counted that as on top. Now an ancestor whose overflow clips the field is checked (clippedOut), and only the field or something inside it counts as the hit.

3. Every [data-pn-annotation-toolbar-row] is checked, not just the first, so a hidden toolbar earlier in the DOM no longer hides a showing one.

Tests

Results

backnotprop and others added 2 commits October 16, 2026 11:24
…ields and every toolbar

Follow-ups from the #1955 review:

- Only a selection inside an attached file's viewer (.ib-view), or a
  selection toolbar showing, keeps the paste where it is. A word
  double-clicked in a thread message or on a choice's label comments on
  nothing, and used to turn the fix off, so the dictation was lost.
- sight(): a field scrolled out of its pane (outside an ancestor that
  clips it) is off screen, and only the field or something inside it
  counts as the field on top; the pane that holds it no longer does.
- Every [data-pn-annotation-toolbar-row] is checked, not only the first.

Tests: an e2e (double-click a word in the message, then dictate: the
words land in the reply box; fails on the #1955 build), and unit tests
for a word selected outside a file view, a hidden toolbar before a
showing one, and a field clipped out of its pane.

Co-Authored-By: Claude <noreply@anthropic.com>
…an open comment box

#1959 narrowed the selection guard to .ib-view, which left the guided
review (.ib-viewer) out. A reviewer who left an inline guide comment
open, selected other code, then dictated had the paste go into the
earlier comment box; before #1959 it was blocked.

ANNOTATABLE_VIEW is now '.ib-view, .ib-viewer'. The guide's diff lives
in Pierre's shadow root, and headless Chromium and WebKit both report
that selection on the document as collapsed, anchored at the shadow
host's parent, while toString() still holds the words. So the guard now
reads the words, not isCollapsed; the retargeted anchor sits inside
.ib-viewer and is found by closest().

Checked in headless Chromium and WebKit with the bundled module: before,
the paste went to the comment box; now focus stays put. Unit test
added (fails on the previous module).

Co-Authored-By: Claude <noreply@anthropic.com>
@backnotprop
backnotprop merged commit 7a2571b into main Oct 16, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant