Repository navigation
Offer a control once when an ARIA wrapper or header says nothing more - #1353
Conversation
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[Medium impact] The PR appears safe to merge; no new actionable issues were found.
|
|
Warning Your comment is too long (maximum is 65536 characters), so the coverage report was not added. See the job log for how to reduce it.
|
baff33e to
f450e95
Compare
|
@greptile review |
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
A role="menuitem" item around its link, a combobox container around its input, and a sortable column header around its sort button were each offered twice. A wrapper around a single control is now a duplicate when, once the control's name and text are taken out, it says nothing the control's name does not, whether the wrapper is a generic clickable or a control itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f450e95 to
4a73034
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Found 1 test failure on Blacksmith runners: Failure
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
What
Some controls were offered twice, by a wrapper and by the control inside it:
<li role="menuitem"><a href="/">Home</a></li>gaveB3 HomeandL3 Home.<th>with a pointer cursor around itsrole="button"sort icon gaveM6 "Age Age: Activate to sort"andB4 "Age: Activate to sort".duplicate_clickables(#1307) already drops a generic clickable around a single control named like it. Two cases slipped through:role="combobox"container), which the rule skipped.A wrapper around a single control is now a duplicate when, once the control's name and text are taken out of the wrapper's label, what is left is made of words of the control's name. That covers generic clickables, ARIA menu items around links or buttons, and ARIA combobox containers around text inputs. Native controls and other ARIA widgets retain their own actions even when their names match the child: the absence of a DOM click handler does not rule out an independent
addEventListenerhandler. A wrapper with a DOM click handler of its own, or with anything else to say ("10:40 AM Paris - Tokyo" around an "Emissions" button, a card around a title link), is kept as before.Example
Before (main), the menu item and the header are offered next to the controls they wrap:
After:
Tests
tests/browser/test_dom_clickable_duplicates.py: menu items around a link and a button, and a sortable header around its sort button, are offered once. A header whose text is not in its button's name keeps both. Fails on main (8 actions instead of 5).checkout/joybird: react-autosuggest'sdiv role="combobox"around the Street address input is no longer offered. It was a second, wrong "select" action for the same field; the input ids after it shift by one.f450e952: all 9 duplicate-wrapper browser tests, both Joybird golden tests, pre-commit/basedpyright, and Python 3.11 compilation pass. The local full offline run was interrupted after 222 passing tests to reduce shared-machine load; it did not complete. The full offline suite and live checks are running in GitHub CI on this head.Bench
The bench ran before the last rebase, on a local build of
feat-session-actwith the coverage tasks and all the observe fixes of this series merged (one build; each task below exercises one fix). Base is the same build without the fixes. Jev, 2 runs each, base and head back to back, concurrency 2, load average 28–40 on a shared machine.dt-filter(Tokyo, oldest first)toolshop-qtyload, a separate bug)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.