LearnNewsExamplesServices
Frontmatter
id14896
titlePure tab-overflow hidden-set computation (computeTabOverflow) — the headless, unit-tested core of #14771
stateClosed
labels
enhancementaiarchitecture
assignees[]
createdAt2:31 PM
updatedAt2:36 PM
githubUrlhttps://github.com/neomjs/neo/issues/14896
authorneo-opus-grace
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAt2:36 PM

Pure tab-overflow hidden-set computation (computeTabOverflow) — the headless, unit-tested core of #14771

Closed Backlog/active-chunk-4 enhancementaiarchitecture
neo-opus-grace
neo-opus-grace commented on 2:31 PM

Context

The headless, unit-testable half of #14771 (tab-overflow affordance, ADR 0029 §2.4, docking epic #13158). Per #14771's AC-1 the hidden-set is a pure computation spec; this leaf lands + proves that algorithm unit-first, de-risking the tricky part (the active-always-visible invariant + edge cases) before the browser-gated visual dropdown consumes it. Spec posted on #14771 (lead design note).

The Fix

A pure DockLayoutAdapter.computeTabOverflow({items, extent, activeItemId, controlWidth}) → {visible: String[], hidden: String[]} — deterministic over its inputs, no DOM read, no render. The adapter measures header widths at render time (the browser half) and passes them in; this function is pure over those measurements.

  • items — ordered [{id, headerWidth}] in projection order.
  • extent — available header-strip width.
  • activeItemIdinvariant: never in hidden (cannot overflow the tab you are viewing).
  • controlWidth — the overflow control's own width, reserved from extent only when overflow occurs.

Acceptance Criteria

  • computeTabOverflow returns the correct {visible, hidden} for the 5 pinned cases: everything-fits (no control, no reserved width); overflow (reserve controlWidth, pack in order); active-always-visible (force-keep the active item, push the last-fitting non-active to hidden); single item wider than extent (visible, degenerate); hidden preserves items order.
  • Pure/deterministic — zero DOM read, zero new persisted state, zero new dock operations (selection still routes through the existing activeItemId path per #14771 AC-2).
  • Unit floor pins all five cases + the active-always-visible invariant.
  • Cross-family review.

Out of Scope

The visual affordance (the dropdown control, header-width measurement, appear/disappear on render, interaction coverage on examples/dashboard/dock) — that is the browser-gated half, stays under #14771. No dock-specific tab-container fork (inherited constraint).

Related

Parent #13158 · headless core of #14771 · authority ADR 0029 §2.4. Decision Record impact: aligned-with ADR 0029. Dup-sweep: rg computeTabOverflow|tabOverflow src/ test/ → none; open-issue sweep → only #14771 (the parent).