Repository navigation
Description
What happens
clients/web/src/components/screens/SkillsScreen/SkillsScreen.stories.tsx > Long Skill Document fails intermittently in the Storybook stage of npm run local:gate, on the final geometry assertion:
AssertionError:
expected [ 48, 202, 178, 262 ] to deeply equal [ 48, 202, 155, 285 ]
Array [
48,
202,
- 155,
+ 178,
- 285,
+ 262,
]
❯ toEqual src/components/screens/SkillsScreen/SkillsScreen.stories.tsx:434:29
The first two elements match; the last two are off by 23px in opposite directions — the two panes are measured mid-redistribution rather than settled.
Where
SkillsScreen.stories.tsx:415-435, the tail of the Long Skill Document play function:
// Collapse then reopen restores the same geometry.
await userEvent.click(viewerControl);
await userEvent.click(viewerControl);
await expect(geometry()).toEqual(before);The assertion reads geometry immediately after the second click, with nothing waiting for the collapse/reopen transition to settle. userEvent.click resolves when the event is dispatched, not when the resulting layout has stabilized, so the measurement races the animation. The earlier assertions in the same play function are toBeGreaterThan / toBeLessThanOrEqual on a single element and are not sensitive to this; the exact toEqual on four numbers is.
The story was added in #2263.
Reproduction
It is intermittent — the point of the issue. Observed once in a full npm run local:gate run (1 failed | 122 passed of 123 files; 523/524 tests), then:
- 3/3 green when the file was re-run in isolation (
npx vitest run --project=storybook src/components/screens/SkillsScreen/SkillsScreen.stories.tsx) - green again in the next full
local:gate(123 files, 524/524)
It surfaced during #2275, a markdown-only PR — git diff origin/v2/main...HEAD --name-only is README.md, clients/cli/README.md, docs/cli-smoke-testing.md, so no client source is involved and the PR cannot be the cause. Machine load looked like the differentiator; the failing run was on a loaded machine.
Why it is worth fixing
AGENTS.md makes local:gate a mandatory pre-push gate and a strict superset of CI, and the repo takes the position that a signal channel nobody can trust is one people learn to skim. A gate that goes red on a PR touching no code teaches exactly that — the next red run gets re-run rather than read.
Suggested fix
Wait for the geometry to settle rather than sampling immediately — e.g. waitFor around the final comparison so it retries until the panes stop moving, or await the transition end on the collapsing element. Tightening a tolerance would hide the race rather than remove it, and would still fail when the sample lands early enough.
Prior art: #1596 (closed) covered timeout flakiness in the web suite generally; this is a specific, reproducible-by-load instance rather than that broader effort.
Activity
cliffhall commentedon Sep 6, 2026
Triage: Priority Medium (total 6)
buglabelNo milestone bonus claimed: this was filed through the
/issue-createflow, where the milestone is the approval act rather than corroborating evidence, so counting it would make the bonus a constant.Board: #28, Status
Todo, milestone v2.7.0 — not v2.6.0, which is due in three days and already carries 12 open issues. Nothing waits on this, so scheduling it against a bucket it plainly cannot make would be the milestone-as-formality failure the rubric warns about.fix: wait for the reopened SkillsScreen layout to settle before compa…
cliffhall commentedon Sep 7, 2026
Fixed by #2291 (merged as d8100e8).
fix: address Copilot review round 4
fix: state every test-gate timeout instead of inheriting a library de…