fix: --by cell ranks candidates by grid, re-resolves replaced nodes, names the cover; key reports focused_id - #30
Merged
Conversation
…names the cover
Three findings from a live timesheet run where `fill --by cell "Tue, …"`
failed as `occluded` on one column in five, every week, while the other
four columns filled fine.
1. cellLocatorJS picked candidates in document order after a geometric
"in this column" filter. Workday's global "Search Workday" input sits
above its Enter Time dialog with its centre inside one day column's
tolerance; it comes first in the DOM and is under the modal overlay,
so that column resolved to an off-grid, covered input and timed out.
Rank candidates instead of filtering: the header's own grid beats the
rest of the page, an unoccluded centre beats a covered one, document
order breaks ties. Off-grid candidates stay as the last resort because
some grids split header and body tables.
TestCellAddressingPrefersGridOverOffGridField reproduces the wrong pick
(value lands in the search box) on the old locator.
2. settledNodePoint polled one resolved node until the deadline. A grid
that re-renders its row after a commit (Workday's does; input ids
change) detaches that node, which then measures 0x0 forever and reads
as `occluded`. The geometry probe now reports `detached`, and the new
settledPointFor / coordClickSelector re-resolve the selector on it;
Type, Fill, Key, the pointer verbs and drag targets all go through it.
Only if the replacement never settles does the caller see a timeout,
now with `detached: true`.
TestCellAddressingReResolvesReplacedNode models the commit-veil-then-
rebuild shape and fails on the old code with the exact message seen live.
3. `occluded: true` said nothing about WHAT was on top, so each failure had
to be reproduced under instrumentation. OccludedError now carries the
element found at the centre and puts it in the message ("its centre is
covered by DIV name=\"modalOverlay\"", or "it measured 0x0"); the
evidence rides in the message because errors cross the daemon as
strings and the envelope must read the same on both paths. IsOccluded
still matches. TestOccludedErrorMessage pins the format.
Live-verified on the real grid with the rebuilt binary: a five-column
session batch fills clean where the released binary failed the Tue cell.
…press `focused` names the focused element by role and accessible name, which is `textbox ""` for every input in a grid — so a stroke that followed a coordinate click into the wrong cell was invisible in the envelope and only showed up in a later value read-back (it did, on a live timesheet: an `8` typed into Sunday instead of Tuesday). Add `focused_id`: `document.activeElement.id` when the element has one, read best-effort like `focused` and omitted otherwise. Additive field, no change to existing shape.
This was referenced Aug 16, 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.
What
Findings from a live Workday timesheet run where
fill --by cell "Tue, …"failed asoccludedon one column in five, every week, while the other four columns filled fine.--by cellcandidates instead of filtering them.The locator picked candidates in document order after a geometric "in this column" test.
Workday's global "Search Workday" input sits above its Enter Time dialog with its centre inside one day column's tolerance; it comes first in the DOM and is under the modal overlay, so that column resolved to an off-grid, covered input and timed out.
Now: the header's own grid beats the rest of the page, an unoccluded centre beats a covered one, document order breaks ties.
Off-grid candidates stay as the last resort (some grids split header and body tables).
settledNodePointpolled one resolved node until the deadline; a grid that re-renders its row after a commit detaches that node, which then measures 0×0 forever and reads asoccluded.The geometry probe now reports
detached;settledPointFor/coordClickSelectorre-resolve the selector on it, and Type, Fill, Key, the pointer verbs and drag targets all go through it.Only if the replacement never settles does the caller see a timeout, now with
detached: true.occludederrors name what is on top.OccludedErrorcarries the element found at the centre and puts it in the message (its centre is covered by DIV name="modalOverlay", orit measured 0x0).The evidence rides in the message because errors cross the daemon RPC as strings and the envelope must read the same on both paths;
IsOccludedstill matches.keyreportsfocused_id(DOM id of what has focus after the press) — the disambiguator for grids whose inputs all read astextbox "".Additive field.
Tests
TestCellAddressingPrefersGridOverOffGridField— reproduces the wrong pick (value lands in the off-grid input) on the old locator.TestCellAddressingReResolvesReplacedNode— commit-veil-then-rebuild fixture; fails on the old code with the exact message seen live.TestOccludedErrorMessage— pins the message format andIsOccludedacross a string-only round trip.focused_idasserted in the existing key test.gofmt -l .clean,go vet ./...,go test -race ./...green locally.Live check
Rebuilt binary against the real grid: a five-column
sessionbatch fills clean where the released binary failed the Tue cell.One residual intermittent post-fill failure (≈1 in 10 on the old binary) was not reproduced after the fix; the new error message will name the cover if it recurs.
Docs
docs/cli-reference.mdandskills/drive-chrome-cdp/SKILL.mdupdated (cell ranking,detached, occlusion evidence,focused_id,Escapeinside a dirty dialog, stale-daemon recovery).