What happened
e2e/code-scroll.spec.ts › a one-line Markdown code block exposes native and selection horizontal scrolling fails intermittently in CI and on cold local runs:
Error: expect(received).toBeGreaterThan(expected)
Expected: > 10
Received: 0
Call Log:
- Timeout 10000ms exceeded while waiting on the predicate
Seen on an unrelated PR's run (https://github.com/apache/maka/actions/runs/33726683004/job/100557131290); locally the first run after a fresh build fails the same way and immediate reruns pass.
Root cause
The drag anchors on a guessed container offset (codeBox.x + 24) and immediately drags out of the viewport. Cold-start font loading reflows the code line after the box was measured, so mousedown can land outside the glyphs: no selection anchor forms, the long drag auto-scrolls (the scroll assertions pass) while the selection stays empty, and the test fails at the end with an opaque zero. Moving the anchor to x + 2 (into the leading whitespace) reproduces the failure 4/5 runs, confirming the anchor-position mechanism.
Reproduction
- Fresh
npm run build:with-deps in apps/desktop.
npx playwright test --config e2e/playwright.config.ts e2e/code-scroll.spec.ts — first run fails, reruns pass.
- Deterministic: change the mousedown x-offset to
codeBox.x + 2 and the selection assertions fail almost every run.
What happened
e2e/code-scroll.spec.ts › a one-line Markdown code block exposes native and selection horizontal scrollingfails intermittently in CI and on cold local runs:Seen on an unrelated PR's run (https://github.com/apache/maka/actions/runs/33726683004/job/100557131290); locally the first run after a fresh build fails the same way and immediate reruns pass.
Root cause
The drag anchors on a guessed container offset (
codeBox.x + 24) and immediately drags out of the viewport. Cold-start font loading reflows the code line after the box was measured, so mousedown can land outside the glyphs: no selection anchor forms, the long drag auto-scrolls (the scroll assertions pass) while the selection stays empty, and the test fails at the end with an opaque zero. Moving the anchor tox + 2(into the leading whitespace) reproduces the failure 4/5 runs, confirming the anchor-position mechanism.Reproduction
npm run build:with-depsinapps/desktop.npx playwright test --config e2e/playwright.config.ts e2e/code-scroll.spec.ts— first run fails, reruns pass.codeBox.x + 2and the selection assertions fail almost every run.