LearnNewsExamplesConnect
Frontmatter
assigneesbardrop
createdAtNov 18, 2026, 5:42 AM
updatedAtNov 18, 2026, 1:04 PM
githubUrlhttps://github.com/neomjs/neo/issues/21303
authorneo-opus-vega
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtNov 18, 2026, 1:04 PM

The tab overflow plugin throws where there is no layout to measure

Closed v14.0.0/archive-v14-0-0-chunk-4 bughelp wantedgood first issueai
neo-opus-vega
neo-opus-vega commented on Nov 18, 2026, 5:42 AM

Please comment to claim before starting; check current assignees and linked PRs.

Context

neomjs.com renders its routes on a server before it serves them, and there is no layout there: a stand-in answers every Neo.main.DomAccess call with an empty object. On every route that renders a tab header, the tab overflow plugin then logs:

Neo.tab.plugin.Overflow: project() threw against a live owner TypeError: rects.shift is not a function

The scheduled site build of 2026-11-17 23:47 UTC logged this line 1,426 times. The pages still render, because the error is caught, but the line buries every real error in that log.

The Problem

project() (src/tab/plugin/Overflow.mjs:872) measures with owner.getLayoutRect(ids) and reads the answer as a list. In a browser it always is one: Neo.main.DomAccess.getLayoutRect maps an array of ids to an array of rects (src/main/DomAccess.mjs:578). Without a layout the answer is one object, and Neo.component.Base#getLayoutRect (src/component/Base.mjs:1559) returns it as a single Neo.util.Rectangle. The first measure (:986) reads it by index and silently gets nothing; the second (:1022) calls rects.shift() at :1029 and throws.

The Architectural Reality

  • The catch at :1147 names the one expected failure ("getLayoutRect losing a race with teardown is the ONE expected failure") and logs everything else as a defect ("a throw against a LIVE owner is a programming defect"). A measure with no layout is neither: nothing went wrong, and there is nothing to project.
  • The finally at :1163 always releases the measuring latch.
  • test/playwright/unit/tab/plugin/Overflow.spec.mjs has a lean owner stub with a replaceable getLayoutRect: createPlugin(getLayoutRect) at :163. The plugin projects once while it is constructed, so capture console.error before calling createPlugin; the test at :208 shows the capture.

The Fix

In project(), when an owner.getLayoutRect(ids) call answers anything other than an array, leave the pass without projecting: apply no split, log nothing, and let the existing finally release the latch. Leave only after the measure reveal at :1024–:1027 has been switched off again. Add a sentence to project()'s JSDoc saying that a measure without layout skips the pass.

Acceptance Criteria

  • AC-1: When owner.getLayoutRect(ids) resolves anything other than an array, project() resolves without throwing and without calling console.error; measuring is false afterwards, and no tab button is hidden or moved into the overflow menu.
  • AC-2: A new test in Overflow.spec.mjs, built on createPlugin(async () => ({})), checks AC-1 and fails on dev without the fix (paste that failure into the pull request).
  • AC-3: npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/tab/plugin/Overflow.spec.mjs passes.
  • AC-4 (post-release, maintainer): the first site build on an engine release with the fix logs no rects.shift is not a function.

Out of Scope

  • The server-side stand-in that answers {}: it belongs to the site's renderer, which is not in this repository.
  • The return shape of Neo.component.Base#getLayoutRect, which other callers read too (for example src/dashboard/dock/interaction/DockSplitter.mjs:249).
  • The /news/discussions render failure in the same log.

Avoided Traps

  • Detecting server-side rendering by a config flag. The stand-in sets flags meant for unit tests, and project() already holds the fact it needs: the shape of the answer.
  • Dropping the catch's console.error. It reports real defects against a live owner and stays.

Live latest-open + closed sweep: checked the latest 20 open (71 open, red band; no owning ticket or epic to fold into) and open and closed searches (Overflow project layout, server-side rendering tab, Overflow project getLayoutRect, rects.shift), with the Out of Scope and Avoided Traps of the same-surface closed #19982 and #16424 read, at 2026-11-18T04:39Z, re-checked at 04:42Z; no equivalent or prior exclusion found. A2A in-flight claim sweep: the 30 newest messages in all read states (to 04:40Z); no claim on this surface. Memory Core: one query on the symptom; the hits are other overflow defects. Own open assignments: #21215, #21033, #21032, #20925, #20667; none on this surface.

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Retrieval Hint: "tab overflow plugin project rects.shift server-side rendering no layout getLayoutRect non-array"

🌿 Vega (Opus 5.5, Claude Code)

bardrop
bardrop Nov 18, 2026, 10:32 AM

I'd like to take this one. I'll add the non-array guard in project() after the measure reveal is switched off, plus the createPlugin(async () => ({})) test.

@github-actions - 2026-11-18T09:32:47Z

Thanks for claiming this, @bardrop, and welcome back! Assigned to you — you can start now.

Your claim reserves this issue for 3 days (any comment here resets the clock; we still merge the first approve-worthy PR if another lands first or a claim goes quiet).

An automatic reply. How claims work [QUARANTINED_URL: github.com]

bardrop cross-referenced by PR #21321 on Nov 18, 2026, 10:36 AM