LearnNewsExamplesServices
Frontmatter
id17988
titleThe tab overflow cap spec reserves one action, not the cluster
stateClosed
labels
bugaitesting
assigneesneo-opus-vega
createdAtSep 1, 2026, 12:06 AM
updatedAtSep 1, 2026, 1:22 AM
githubUrlhttps://github.com/neomjs/neo/issues/17988
authorneo-opus-vega
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 1, 2026, 1:22 AM

The tab overflow cap spec reserves one action, not the cluster

Closed Backlog/active-chunk-19 bugaitesting
neo-opus-vega
neo-opus-vega commented on Sep 1, 2026, 12:06 AM

Context

dev is red. The Engine Tests workflow's components job fails at fa20136f29, and the workstation/ e2e directory carries a second red at the same base: WorkstationTabOverflowCapNL has been failing since #17963's design pass (merged PR #17977) turned on the close/pin/maximize actions in apps/workstation.

Measured at dev@fa20136f29:

cap must derive from the rendered control width (extent 275.59375, control 24)
Expected: 251
Received: 203

Production is right and the spec is stale. This ticket corrects the spec.

The Problem

test/playwright/e2e/workstation/WorkstationTabOverflowCapNL.spec.mjs asserts a single arithmetic identity for the cap the overflow plugin applies to a degenerate over-wide active tab button:

expect(facts.capped.maxWidth).toBe(Math.floor(facts.toolbarRect.width) - Math.ceil(facts.control.width));

floor(275.59) - ceil(24) = 251. The plugin applied 203. The delta is 48, which is exactly 2 × 24px.

That number is the whole diagnosis. The header toolbar no longer ends with one action. Measured live in the running app on the heavy Priority Alert Observatory header:

action width visibility
More tabs (the overflow control) 24px visible
maximize 24px hidden (focus-gated, geometry preserved)
close 24px visible

Cluster width 72px, and 275 - 72 = 203 — the value the plugin actually wrote. The plugin reserves the full trailing action cluster; the spec's formula reserves only the overflow control. The formula was correct when the overflow control was the sole trailing action, which is the world #16424 and #17960 were written in.

Every other assertion in the same test passes, and that is what convicts the formula rather than the plugin:

  • capped.controlIx === 0 — the capped box has zero painted intersection with the control.
  • capped.rect.right <= control.left + 0.5 — the box ends at or before the control edge.
  • the per-button indicator spans the capped box to within 1px.
  • every pressed button's ix === 0 — nothing paints beneath the control.

So the geometry the test exists to protect is intact. Only the identity that re-derives the number from one operand is wrong, and it now under-reserves by the width of the two actions the app gained.

Note the gated maximize is counted, correctly. The focus-gating carrier toggles interactivity while preserving geometry (resources/scss/src/toolbar/Base.scss — visibility: hidden, not display: none), so a quiet action still occupies its box and a tab running under it would still be covered. A repair that counted only visible actions would pass today and break the moment the pane takes focus.

The Architectural Reality

  • The reserve is computed from the rendered trailing cluster, not from a single control, because the tab-overflow plugin bounds the active button against whatever the toolbar's action partition actually occupies. The header action family (#17945 pin, #17953 maximize, #17948 reload, #17419 close, #17960 overflow-as-first-action) made that partition variable per consumer and per opt-in flag.
  • The spec's own comment states the intent correctly — "the cap the plugin applied equals the toolbar extent minus the RENDERED control width — not the pre-creation estimate". The rendered, not estimated half is the load-bearing part and stays. Only the extent of "what is reserved" changed from one action to the cluster.
  • apps/workstation is the staging ground: it is the app that both overflows a header and now enables the full engine set, so it is the only place this identity can be exercised end to end.

The Fix

test/playwright/e2e/workstation/WorkstationTabOverflowCapNL.spec.mjs only. No production change.

  1. Collect the trailing action cluster from the rendered toolbar — every :scope > .neo-toolbar-action, gated or not — and derive its extent from the DOM, not from a count times an assumed size.
  2. Replace the single-operand identity with the cluster identity, keeping the rendered-not-estimated discipline.
  3. Assert the cluster is non-degenerate (more than one action) so the repair cannot silently pass by collapsing back to the single-control case; and keep counting gated actions, with the reason written in the spec.

Contract Ledger

Target Surface Source of Authority Behavior Fallback Docs Evidence
WorkstationTabOverflowCapNL cap identity the tab-overflow plugin's applied maxWidth re-derived from the rendered trailing action cluster none — a stale identity is the defect in-spec comment naming why gated actions count green at dev head; the arithmetic reproduces 203 from measured DOM

No production surface changes.

Decision Record impact

none. Test-only correction.

Acceptance Criteria

  • WorkstationTabOverflowCapNL passes at the current dev head, with the cap identity re-derived from the rendered trailing action cluster rather than a single control.
  • The cluster extent is measured from the DOM — not a hardcoded action count, and not a count multiplied by an assumed action size.
  • Gated (visibility: hidden) actions are counted, with the reason written in the spec: the carrier preserves geometry, so a quiet action still occupies its box.
  • A guard asserts the cluster holds more than one action, so the repair cannot pass by degenerating back to the single-control case it replaced.
  • Every existing geometry assertion in the test is unchanged — the zero-intersection, edge, indicator-span and ellipsis checks are what the test is for, and they already pass.
  • The workstation/ e2e directory shows this spec green; WorkstationStarvedGeometryNL is expected to remain red and is out of scope (see below).

Out of Scope

  • WorkstationStarvedGeometryNL — the other red at the same base (the taller box grows the row pool without frames, expected > 29, received 29). Different subject (renderer starvation / row pool), needs its own measurement and its own ticket.
  • DockReload.spec.mjs:181 — the components job's red. A Playwright strict-mode violation (resolved to 2 elements), so tab-bar arity, not this. Tracked against #17980's subject; the production side is mine via #17948.
  • Any change to the tab-overflow plugin. Its geometry is correct and every geometric assertion already proves it.
  • Whether the engine action set should be reservable per-action rather than as a cluster — a design question no measurement here raises.

Avoided Traps

  • Loosening the assertion to a tolerance. A toBeCloseTo would go green and stop testing the thing the identity exists for: that the cap is re-derived from render truth rather than an estimate. The identity stays exact; only its operand is corrected.
  • Counting only visible actions. Passes today, breaks the moment a pane takes focus and the gated actions become visible — and it would silently re-introduce the covered-tab defect #16424 was filed for, because a gated action still occupies its box.
  • Hardcoding 3 or 72. The action count is per-consumer and per-flag; the next opt-in would re-red it. Measure the cluster.
  • Fixing it in the plugin. The plugin produced the correct number. Changing production to satisfy a stale test is the inversion this ticket exists to avoid.

Related

Parent: #13158. Stale since #17963 (merged PR #17977) enabled the engine action set in apps/workstation. Original defect the spec guards: #16424 (active tab indicator ran beneath the floating overflow control). Action-family leaves that made the trailing partition variable: #17419, #17945, #17948, #17953, #17960. Sibling red at the same base, deliberately excluded: WorkstationStarvedGeometryNL.

Live latest-open sweep: latest 20 open issues checked 2026-08-31T22:05:32Z; no equivalent — the nearest match, #16424, is CLOSED and is the defect this spec guards, not this staleness. A2A in-flight claim sweep: 30 most recent messages, newest 2026-08-31T21:53Z; no claim on this scope. Filed inside the operator's 21:28Z topic freeze (docklayout / tab header actions / styling).

Origin Session ID: a4fa24e6-b983-4ecd-81a2-8b98baef9cfc

Retrieval Hint: "workstation tab overflow cap spec reserves one action not the trailing cluster 251 vs 203"

— Vega (Opus 5, Claude Code) 🌿