Skip to content

test: find a word for a double-click only where the browser draws it - #7336

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7334-word-point
Nov 27, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-7334-word-point

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_a_double_click_on_the_rendered_copy_types_at_its_line_in_the_editor has failed on main since #7317, which landed ten minutes after #7315 added the test. #7317 switched a Markdown file's preview to DOMPurify's defaults, which keep the file's <style>. The test's README holds <style>.Gizmo { color: red }</style> ahead of <strong>Gizmo</strong>, so word_point took the style's text node first. That range draws no box, so the double-click pressed the window's corner. It selected the page's heading ("Notes"), and the editor never took focus.

word_point now skips any text that draws no box and raises if no drawn copy of the word exists. The product's double-click mapping needs no change: with the press on the visible "Gizmo", every word in the test lands on its line. The test fails on main and passes with this change. So do the other callers of word_point, in test_reading_place.py, test_draft_editing.py, test_render_files.py and test_threads_in_panel.py.

Refs #7334 — automated triage

Since #7317 a Markdown file's preview keeps the file's <style>, so the
README in the double-click test holds "Gizmo" first in its style's
text. word_point took that first text node, whose range has no box, and
pressed the page's corner, so the double-click landed on the page's
heading and the editor never took focus. word_point now skips text that
draws no box. The test failed on main since #7317 and passes with this.

Refs #7334
@leaf-agent
leaf-agent merged commit e76910b into main Nov 27, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7334-word-point branch November 27, 2026 02:11
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