Skip to content

Offer the focusable cells of a grid, such as date picker days - #1350

Merged
giordano-lucas merged 1 commit into
mainfrom
fix-observe-grid-cells
Oct 26, 2026
Merged

giordano-lucas merged 1 commit into
mainfrom
fix-observe-grid-cells

Conversation

@giordano-lucas

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

Copy link
Copy Markdown
Member

What

A date picker dialog lays its days out in a role="grid" table. The cells are focusable (tabindex="-1", the focused day tabindex="0"), move with the arrow keys and act on click. Nothing observe() looks at marks them as controls: no role from its list, no pointer cursor, and handlers added with addEventListener. On the W3C APG date picker, the month buttons were offered and the days were text only, so an agent could open the dialog and turn the months but never pick a day.

A focusable cell of an interactive grid is now interactive: role="gridcell", or a <td> of a table with role="grid" or "treegrid", that has a tabindex and some text. The empty cells before the first day of a month are fillers and stay out. Cells of ordinary data tables are unchanged.

Example

<div role="dialog" aria-label="Choose a date">
  <button>Next month</button>
  <h2>November 2026</h2>
  <table role="grid">
    <tr><th>Sa</th><th>Su</th></tr>
    <tr><td tabindex="-1"></td><td tabindex="-1">1</td></tr>
    <tr><td tabindex="0" aria-selected="true">14</td><td tabindex="-1">15</td></tr>
  </table>
</div>

Before (main), the days are text only:

B1[:]<button>Next month</button>
_[:]November 2026
_[:]Sa
_[:]Su
_[:]1
_[:]14
_[:]15

After, the days are offered (the empty filler cell is not):

B1[:]<button>Next month</button>
_[:]November 2026
_[:]Sa
_[:]Su
M1[:]<td tabindex="-1">1</td>
M2[:]<td tabindex="0">14</td>
M3[:]<td tabindex="-1">15</td>

Tests

  • New tests/browser/test_dom_grid_cells.py: the days of a grid are offered and clicking one picks it. Empty filler cells, header cells and a focusable cell of a plain table are not offered. Fails on main (no day offered).
  • No golden or characterization snapshot changes. Full offline suite passed before the last rebase on main; on this head, tests/browser, the golden and characterization suites, pre-commit and basedpyright pass.

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
apg-datepicker (pick 15 November 2026) 0/2: turned months until the guard stopped it 2/2

🤖 Generated with Claude Code


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

The days of a date picker dialog are focusable cells of a role="grid" table that act on
click, with no role, cursor or handler attribute that marks them as controls. Only the
buttons around the grid were offered, so a day could not be picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7cbb5e3 and 35b8fb2.

Files selected for processing: 2
  • packages/notte-browser/src/notte_browser/js/buildDomNode.js
  • tests/browser/test_dom_grid_cells.py

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: 4/5

[Medium impact] The change affects which browser actions are offered for interactive grids.

The grid-cell fix needs to cover grids with delegated click handlers before merging.

Fix All in Claude CodeFindings

  1. P1 Day cells remain unavailable ▶
Fix with agent prompt
### Issue 1
packages/notte-browser/src/notte_browser/js/buildDomNode.js:1246
If a grid handles clicks on its container, such as a `table[role="grid"]` with a delegated `onclick`, its text-only day cells still get no action IDs. The table is highlighted first. The cells now pass `isInteractiveElement`, but `handleHighlighting` rejects them because `isElementDistinctInteraction` does not recognize grid cells. The agent can target the table but cannot choose a particular day.

Apply the same grid-cell check to `isElementDistinctInteraction` and add a test with a delegated handler.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Offers nonempty, focusable grid cells as browser actions.

  • Agents can choose focusable days in interactive grids.

Reviews (1) · Last reviewed commit: "Offer the focusable cells of a grid, suc..." · Reviewed by Greptile


// the focusable cells of a grid (the days of a date picker), which act on click; the empty cells
// before the first day of a month are fillers
if (hasAttribute(element, "tabindex") && isGridCell(element) && (propertyOf(element, "textContent") || "").trim() !== "") return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Day cells remain unavailable

If a grid handles clicks on its container, such as a table[role="grid"] with a delegated onclick, its text-only day cells still get no action IDs. The table is highlighted first. The cells now pass isInteractiveElement, but handleHighlighting rejects them because isElementDistinctInteraction does not recognize grid cells. The agent can target the table but cannot choose a particular day.

Apply the same grid-cell check to isElementDistinctInteraction and add a test with a delegated handler.

Knowledge Base Used: Browser DOM and rendering

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/notte-browser/src/notte_browser/js/buildDomNode.js
Line: 1246

Comment:
**Day cells remain unavailable**

If a grid handles clicks on its container, such as a `table[role="grid"]` with a delegated `onclick`, its text-only day cells still get no action IDs. The table is highlighted first. The cells now pass `isInteractiveElement`, but `handleHighlighting` rejects them because `isElementDistinctInteraction` does not recognize grid cells. The agent can target the table but cannot choose a particular day.

Apply the same grid-cell check to `isElementDistinctInteraction` and add a test with a delegated handler.

**Knowledge Base Used:** [Browser DOM and rendering](https://app.greptile.com/nottelabs/-/custom-context/knowledge-base/nottelabs/notte/-/docs/browser-dom-and-rendering.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #1364: isElementDistinctInteraction now uses the same grid-cell check (isGridCellControl), with a test that uses a delegated table handler.

@github-actions

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
3396 6 💤 0 ❌ 0 🔥 6m 7s ⏱️

@giordano-lucas
giordano-lucas merged commit b122d73 into main Oct 26, 2026
26 checks passed
@giordano-lucas
giordano-lucas deleted the fix-observe-grid-cells branch October 26, 2026 17:34
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