Repository navigation
Make a text field's host a group, so a screen reader hears an empty field as empty - #7267
Merged
Merged
Conversation
…ield as empty A `leaf-text` host took `role="textbox"` so Playwright and axe, which can't see into its closed root, would find the field. Chromium reads a textbox that isn't a native input by its light-DOM text, `aria-hidden` included, and parents what is slotted into it under the textbox. Read from Chromium's accessibility tree before this change: - the panel's thread reply box after a Resolve: a textbox valued `Resolved “…”\nNext thread\nt`, holding the button "Next thread t" and a second, empty textbox, the content node focus lands in; - the panel's page box: a textbox valued `Away\nNext On Me\nm`, holding "Next On Me m"; - a margin card's Reply, with no press: a textbox valued `Reply…\n⏎\n· New line\n⇧⏎`. #5613 hid the placeholder's words with `aria-hidden`, which kept them out of the tree as nodes but not out of the host's value. The host now takes `role="group"`: each field reads as a group named for the box, holding its press as a button beside one empty textbox whose placeholder carries the words. `leaf-dev stills --base` shows no change in Chromium, Firefox or WebKit. ARIA allows `aria-multiline` only on a textbox, so the one-line declaration on the host is renamed to Leaf's boolean attribute `one-line` (the name the code and prose already gave the concept, as HTML calls a text input "a one line plain text edit control"). text-field.js, input.js, response.css, lf-options-addition.js and module-input.md move to it; the content node still states `aria-multiline` itself. The file editor's `aria-multiline` stays: it is on that editor's own CodeMirror textbox. Tests: Playwright's role engine can't see the textbox inside the closed root, so the 82 `get_by_role("textbox", …)` locators that found a Leaf field now call `text_field(scope, …)` (leaf_dev.browser), the `leaf-text` group by the same name and exactness; the 51 that find a page's own input, textarea or editor are unchanged. #5613's Resolve test now reads the field's accessibility tree and requires exactly one textbox, empty and holding no button, beside the press; `accessible_tree` replaces `accessible_node`, which it alone used. The options tests read `one-line` where they read `aria-multiline="false"`.
leaf-agent
previously approved these changes
Nov 26, 2026
# Conflicts: # dev/leaf_dev/browser.py
leaf-agent
approved these changes
Nov 26, 2026
This was referenced Nov 26, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 26, 2026
…ince #7267 made its host a group (#7277) `test_on_me_claims_nothing_before_the_first_replay` failed on main ([run 45808911571](https://github.com/max-sixty/leaf/actions/runs/45808911571), `dcf5eb41c`). It asserted `to_be_editable()` on the `leaf-text` host, and #7267 made that host `role="group"` so a screen reader hears one inner textbox. Playwright refuses that assertion on a group ("Element is not an <input>, <textarea>, <select> or [contenteditable]…"). The test now types a character into the page's comment field while the first state answer is still held, checks the field holds it, and deletes it. The behavior it protects is the same: the field takes words before the log has answered. #7267's change stays as it is. Verification: the test fails on main with the error above and passes on this branch (Chromium, locally). The same run's other failures already have owners: `test_a_stuck_sidebar_track_keeps_its_place_to_the_page_end` is waiting on the maintainer in #7245, and #7274 fixed `test_a_thread_on_words_a_widget_renders_stands_where_the_widget_does` after this run's commit. Refs #7276 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 26, 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.
A
leaf-texthost now takesrole="group", and the node inside is the field's one textbox. Chromium reads a textbox that isn't a native input by its slotted text,aria-hiddenincluded, so a screen reader heard the panel's empty reply box as a textbox holding "Resolved “…” Next thread t", with the Next thread button inside it and a second, empty textbox inside that. Every rich hint did too: an idle margin Reply held "Reply… ⏎ · New line ⇧⏎". Now it hears a group holding the press as a button beside one empty textbox.leaf-dev stills --baseshows no change in Chromium, Firefox or WebKit.ARIA allows
aria-multilineonly on a textbox, so the one-line declaration becomes Leaf's booleanone-line, and every reader,module-input.mdincluded, moves to it.To weigh: Playwright can't see into the closed root, so tests that found a field by role textbox now call
text_field(scope, name), which finds theleaf-textgroup by the same name and exactness. 82 locators changed mechanically; 51 finding a page's own inputs stay.Tests: focused browser tests (press, Undo, Next On Me, one-line options, rewritten locators);
pnpm run test:runtime.