Skip to content

Offer a control once when an ARIA wrapper or header says nothing more - #1353

Merged
giordano-lucas merged 3 commits into
mainfrom
fix-observe-duplicate-control-wrappers
Oct 26, 2026
Merged

giordano-lucas merged 3 commits into
mainfrom
fix-observe-duplicate-control-wrappers

Conversation

@giordano-lucas

@giordano-lucas giordano-lucas commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What

Some controls were offered twice, by a wrapper and by the control inside it:

  • Toolshop's menu: <li role="menuitem"><a href="/">Home</a></li> gave B3 Home and L3 Home.
  • DataTables' headers: a <th> with a pointer cursor around its role="button" sort icon gave M6 "Age Age: Activate to sort" and B4 "Age: Activate to sort".

duplicate_clickables (#1307) already drops a generic clickable around a single control named like it. Two cases slipped through:

  • The wrapper was itself a control (an ARIA menu item, a role="combobox" container), which the rule skipped.
  • The wrapper's label was the control's name plus words of it (the header's "Age").

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 addEventListener handler. 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

<ul>
  <li role="menuitem"><a href="/" data-test="nav-home">Home</a></li>
</ul>
<table><tr>
  <th style="cursor: pointer">Age <span role="button" tabindex="0" aria-label="Age: Activate to sort"
    style="display: inline-block; width: 12px; height: 12px"></span></th>
</tr></table>

Before (main), the menu item and the header are offered next to the controls they wrap:

B1[:]<li role="menuitem"></li>
L1[:]<a href="/">Home</a>
M1[:]<th>Age</th>
B2[:]<span tabindex="0" role="button" aria_label="Age: Activate to sort"></span>

After:

L1[:]<a href="/">Home</a>
_[:]Age
B1[:]<span tabindex="0" role="button" aria_label="Age: Activate to sort"></span>

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).
  • Independently wired checkbox, switch, radio, menuitemcheckbox, menuitemradio, button, and tab wrappers retain their action alongside an identically named link. The regression clicks each offered action and checks that opening the link does not toggle the wrapper.
  • Golden snapshot checkout/joybird: react-autosuggest's div 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.
  • Validation on 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-act with 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.

task / probe base head
dt-filter (Tokyo, oldest first) 0/2 2/2, with the sort-state fix
toolshop-qty 0/2 0/2: menu items now offered once; both versions stop on an empty product page (data loaded after load, a separate bug)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

The PR removes duplicate menu-item and combobox wrappers, and recognizes sortable headers that repeat words from their button’s name.

  • Page actions show wrapped controls only once.

Reviews (2) · Last reviewed commit: "Preserve independent controls when remov..." · Reviewed by Greptile

Comment thread packages/notte-browser/src/notte_browser/dom/builder.py
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Coverage

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.

Tests Skipped Failures Errors Time
3543 6 💤 0 ❌ 0 🔥 6m 53s ⏱️

@giordano-lucas
giordano-lucas force-pushed the fix-observe-duplicate-control-wrappers branch from baff33e to f450e95 Compare October 26, 2026 17:47
@giordano-lucas

Copy link
Copy Markdown
Member Author

@greptile review

@giordano-lucas

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 26, 2026
@giordano-lucas

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@giordano-lucas

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

giordano-lucas and others added 2 commits October 26, 2026 22:33
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>
@giordano-lucas
giordano-lucas force-pushed the fix-observe-duplicate-control-wrappers branch from f450e95 to 4a73034 Compare October 26, 2026 21:48
@greptile-apps
greptile-apps Bot dismissed their stale review October 26, 2026 21:48

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@blacksmith-sh

blacksmith-sh Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_a_repeated_request_is_still_waited_for_while_it_runs View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@giordano-lucas
giordano-lucas merged commit d8dfc84 into main Oct 26, 2026
4 of 5 checks passed
@giordano-lucas
giordano-lucas deleted the fix-observe-duplicate-control-wrappers branch October 26, 2026 22:20
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