Skip to content

Let a click press a thread button while words are selected - #3839

Closed
max-sixty wants to merge 1 commit into
mainfrom
grind/s-fold-click
Closed

max-sixty wants to merge 1 commit into
mainfrom
grind/s-fold-click

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

With words selected in a thread message, clicking a summary's "Show/Hide N earlier messages" button did nothing (Enter worked). The capture-phase drag guard in browser/runtime/widget-elements.js used closest("[data-lf-offer]"), which also matches the empty data-lf-offer="" on every thread card and message; reachedForWords(card) is then true for any selection in the card, so the click was stopped. This affected every non-offer button inside a thread.

The guard now uses PRESSABLE ([data-lf-offer]:not([data-lf-offer=""])), already the module's single statement of what is a press, so the guard and the other passes can't diverge. The guard's purpose (a drag ending on a real control is not a press) is unchanged.

Evidence: test_a_summary_folds_its_messages_where_they_stand now clicks the fold button with words selected. Without the fix it fails in both engines ([browser], [webkit_browser]); with it, both pass.

Ran: that test (both engines), pnpm run test:runtime (545 pass), pre-commit on the changed files, pnpm run build:browser (kernel rebuilt). Not run: the wider browser suite.

This was written by Claude Code on behalf of max-sixty

The drag guard in widget-elements.js found its control with
closest("[data-lf-offer]"), which also matches the empty data-lf-offer=""
that every thread card and message wears for chrome. reachedForWords(card)
is true for any selection inside the card, so the click was stopped and
prevented: with words selected in a thread, no button in it (a summary's
Show/Hide earlier messages) responded to the pointer. Enter worked, which
is why the summary test never caught it.

The guard now asks for PRESSABLE, the one statement of what counts as a
press (a non-empty data-lf-offer). A drag that ends on a real control is
still refused, as before.

The summary fold test now clicks the fold button with words selected; it
fails (Chromium and WebKit) without the change and passes with it.
dist/kernel rebuilt.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@max-sixty

Copy link
Copy Markdown
Owner Author

Superseded by #3928, which fixes the same fold-button press with words selected and keeps guarding links and drags inside thread messages.

This was written by Claude Code on behalf of max-sixty

@max-sixty max-sixty closed this Oct 25, 2026
max-sixty added a commit that referenced this pull request Oct 25, 2026
…3928)

With words selected in a thread message, pressing "Show N earlier
messages" (or "Hide …") on a summary did nothing, however many times the
user pressed it. Enter worked.

The cause is the drag guard in `widget-elements.js`, which drops a click
it reads as the mouseup that ended a text selection. It asked that of
`ev.target.closest("[data-lf-offer]")`. A thread card, a message and the
panel's reader all carry an empty `data-lf-offer`, which marks chrome a
widget made but not a press, so the closest match for a button inside a
card was the card itself. The selection's focus was inside the card, so
the guard took every press on every native button and link in that card
for the end of a drag.

The guard now asks the innermost control the press landed on:
`closest(PRESSES, [data-lf-offer])`. A button or link inside widget
chrome answers for itself, and a drag that ends on a selectable offer or
in a message's words is still refused as before.

Evidence: `test_a_summary_folds_its_messages_where_they_stand` now
presses the toggle with the pointer while the message's words stay
selected, where it used Enter before. It fails on main in Chromium and
WebKit (the toggle never folds) and passes with this change. A scratch
run of the same journey in Playwright's Firefox also folds and unfolds
with the fix.

Supersedes #3839 (closed), which changed the same guard to
`closest(PRESSABLE)` and carried nothing this change lacks. The two
differ only where a press lands on chrome a widget made: #3839 never
guards a native button or link without `data-lf-offer`, nor a click
ending a drag in a thread message's words; this one asks the innermost
control, so a link in a message still refuses the release of a drag that
ended in its words, and a drag ending in message prose is refused as
before.

Ran: that test in both engines, the drag-guard tests
(`test_working_the_evidence_in_an_option_is_not_a_pick`,
`test_the_draft_box_is_its_own_door`,
`test_a_selection_around_a_targets_buttons_does_not_deaden_them`,
`test_a_pointer_drag_stops_the_line_offering_the_press_it_refuses`,
`test_playground_labels_can_be_selected_without_changing_the_controls`,
`test_the_panel_field_offers_selected_words_to_a_press_alone`,
`test_a_drag_that_overshoots_the_layer_is_not_a_passage`,
`test_a_label_press_keeps_the_controls_current_keyboard_location`),
`pnpm run test:runtime`, and `pnpm run build:browser` for the kernel.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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