Repository navigation
Offer the focusable cells of a grid, such as date picker days - #1350
Conversation
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>
|
Warning Review limit reachedYou'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. View limit details
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 change affects which browser actions are offered for interactive grids. The grid-cell fix needs to cover grids with delegated click handlers before merging.
|
|
|
||
| // 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; |
There was a problem hiding this comment.
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.There was a problem hiding this comment.
Fixed in #1364: isElementDistinctInteraction now uses the same grid-cell check (isGridCellControl), with a test that uses a delegated table handler.
|
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.
|
What
A date picker dialog lays its days out in a
role="grid"table. The cells are focusable (tabindex="-1", the focused daytabindex="0"), move with the arrow keys and act on click. Nothingobserve()looks at marks them as controls: no role from its list, no pointer cursor, and handlers added withaddEventListener. 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 withrole="grid"or"treegrid", that has atabindexand 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
Before (main), the days are text only:
After, the days are offered (the empty filler cell is not):
Tests
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).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-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.apg-datepicker(pick 15 November 2026)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.