oficina / docs Public

browser-drive: count the bar's own tab stops without the rows of closed panels

Chrome still lays out the contents of a closed <details>, so the count
took the account menu's rows as stops (10, not 5). Checked in Playwright:
from the brand, the editor is 8 presses away on the document page, the
bar's 5 stops + menu bar + toolbar + editor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 4b79b6c81bcc37f520b73bff6e62dc9168623191 parent 37f0559
1 file changed, +3 −2
  • fixtures/browser-drive.mjs +3 −2
diff --git a/fixtures/browser-drive.mjs b/fixtures/browser-drive.mjs
index 33a45c8..b2f1494 100644
--- a/fixtures/browser-drive.mjs
+++ b/fixtures/browser-drive.mjs
@@ -1047,13 +1047,14 @@ async function caretChecks() {
)
// How many tab stops the bar itself has after the brand, counted from
// the live page rather than pinned: the title field and its Rename
- // button, Share…, the switcher when configured, the account trigger.
+ // button, Share…, the switcher when configured, the account trigger —
+ // not the rows inside a closed panel, which Chrome still lays out.
// Pinning a total is what made the old bound go stale when the bar
// changed; what check 8 below holds is the claim that matters — the menu
// bar and the formatting bar are ONE stop each.
const barStops = await evaluate(
`(()=>{const bar=document.querySelector('[estilo-bar]');const brand=bar.querySelector('[estilo-bar-brand]');` +
- `return [...bar.querySelectorAll('a[href],button,input,summary')].filter(e=>e!==brand&&e.tabIndex>=0&&!e.disabled&&e.getClientRects().length>0&&getComputedStyle(e).visibility!=='hidden').length})()`,
+ `return [...bar.querySelectorAll('a[href],button,input,summary')].filter(e=>{const shut=e.closest('details:not([open])');return e!==brand&&e.tabIndex>=0&&!e.disabled&&(!shut||e.matches('summary')&&e.parentElement===shut)&&e.getClientRects().length>0&&getComputedStyle(e).visibility!=='hidden'}).length})()`,
)
await sleep(200)
let reachedAfter = -1