fix: clear the CI reds on main (Mermaid E2E sampling, plan-reminder autofocus, harbor-cell deadline race) - #2001
Merged
Merged
Conversation
`toolbar.top - figure.top` is structurally the figure's 1px top border: the Toolbar is the figure's first flex child, so zoom cannot move it. The assertion still read 2-3px of change in CI because it derived that offset from two independent boundingBox() round-trips, and the transcript is a bottom-pinned scroller that re-pins on every ResizeObserver update — the zoom-induced viewport reflow lands between the two samples and the scroll drift shows up as a phantom offset. Read both the toolbar offset and the viewport height inside one evaluate, so the pair is sampled in a single frame, and poll for the steady state instead of the frame right after the click: the zoomed layout settles over a rAF, a ResizeObserver pass, and the scroller's re-pin. The 1px tolerance is unchanged; only the sampling is fixed. Closes #2000
Astro-Han
force-pushed
the
test/2000-mermaid-toolbar-offset
branch
from
August 3, 2026 11:41
5ee7c27 to
36eeac1
Compare
#2002 rebuilt the dialog's title row as a bare <input autoFocus> inside a Field, replacing a TextInput with `hasAutoFocus`. Astryx's Dialog picks its initial focus target by querying `[data-autofocus]` after showModal(), and its own source documents why React's autoFocus cannot work here: it calls .focus() during commit, while the dialog is still invisible, so the focus silently fails. TextInput emits `data-autofocus`; the bare input did not, so opening 编辑提醒 left the caret on the close button instead of the title. Move the field onto the same seam. Caught by the E2E that asserts the title box is focused when the edit dialog opens.
The force-stop test asserts that the deadline stops an *active* isolated tool, but established that precondition by giving the cell 1000ms of wall clock to finish setup, create the session, and drive the first send before the timer fired. Lose that race on a loaded runner and the run is still cancelled by `benchmark.deadline` — settledByDeadline stays true — while the backend is never stopped, so `stopModes` is empty. That is the CI failure: actual [] vs expected ['immediate']. Reproduced by forcing the ordering with a 1ms deadline, which yields the same signature. Budget the setup at 3000ms instead of 1000ms and assert the precondition directly, so losing the race reports 'the isolated tool never started within the budget' rather than a bare deepEqual mismatch.
Astro-Han
marked this pull request as ready for review
August 3, 2026 11:58
Astro-Han
pushed a commit
that referenced
this pull request
Aug 3, 2026
Squashed onto latest main. The PR's own CI was red for a reason unrelated to its code: the branch snapshot predated #2001's plan-reminder autofocus fix (f7cb2c3), so e2e_shard (1/2) failed on plan-reminders.spec.ts:86 (toBeFocused) under the stale merge-ref. Main's e2e has been green since #2001; squashing re-bases the change onto the fixed code. Independent review (3x deepseek-v4-flash): PASS, no P0/P1. Retry/deadline/fail-closed mechanism verified (RED: database is locked on old logic; GREEN: 0 failures; non-BUSY errors throw immediately; 5s bound enforced). Known follow-up (pre-existing, not blocking): the same fresh-open WAL race remains in configureSqliteSessionMetadataDatabase (no retry on journal_mode switch); track separately if desired.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three independent failures were keeping
main's CI red. Each is fixed at its cause, not by widening a tolerance or adding a retry.1. Mermaid toolbar offset E2E (
e2e_shard 2/2) — the assertion measured the wrong thing. Failing on six consecutive runs across unrelated branches plus two onmain, reading 2px or 3px against a<= 1bound. The offset it measures cannot move:Toolbaris the first flex child offigure.maka-mermaid-diagram, and the figure carries a 1px border, sotoolbar.top - figure.topis structurally that border regardless of zoom. The change came from the sampling — the offset was derived from two independentboundingBox()round-trips, and the transcript is a bottom-pinned scroller that re-pins on every ResizeObserver update (use-chat-scroll.ts). Zooming widens the canvas, the viewport gains a scrollbar,mermaid-diagram.tsxrecomputesviewportHeighton the next frame, the figure changes height, and the scroller re-pins — landing between the two samples and turning scroll drift into a phantom offset. Both the toolbar offset and the viewport height are now read inside oneevaluate, and the comparison polls for the steady state instead of the frame right after the click. The 1px tolerance is unchanged.2. Plan-reminder edit dialog (
e2e_shard 1/2) — a real product regression. #2002 rebuilt the dialog's title row as a bare<input autoFocus>inside aField, replacing aTextInputwithhasAutoFocus. Astryx'sDialogpicks its initial focus target by querying[data-autofocus]aftershowModal(), and its own source documents why React'sautoFocuscannot work there: it calls.focus()during commit, while the dialog is still invisible, so the focus silently fails.TextInputemitsdata-autofocus; the bare input did not, so opening 编辑提醒 left the caret on the close button instead of the title field. Moved onto the same seam. The E2E was reporting a genuine bug.3. Harbor-cell force-stop test (
test_headless) — a race, not a flake. The test asserts the deadline stops an active isolated tool, but established that precondition by giving the cell 1000ms of wall clock to finish setup, create the session, and drive the first send before the timer fired. Lose that race and the run is still cancelled bybenchmark.deadline—settledByDeadlinestays true — while the backend is never stopped, sostopModesis empty. Setup costs ~100ms locally; on a loaded runner it can exceed the budget. The setup budget is now 3000ms and the precondition is asserted directly, so losing the race reports "the isolated tool never started within the budget" instead of a bare deepEqual mismatch.Closes #2000
Root cause evidence
toolbar.top - figure.topis a constant by construction, which makes any non-zero delta a sampling artifact. Not reproduced live — see Verification.Dialog.tsx:443-452, which both implements the[data-autofocus]seam and documents the ReactautoFocusfailure mode, plus thegit showof redesign(ui): rebuild the plan-reminder form as a grouped-row panel #2002 replacinghasAutoFocuswithautoFocus.actual: []vsexpected: [ 'immediate' ]. Restoring the ordering makes it pass.Verification
test_headless,test_workspaces,typecheck,alignment_audit.@maka/uitypecheck and Biome clean on the touched files.firstWindow()times out. CI is the verification for Add Rive workflow Maka tool #1 and Harden runtime, storage, gateway, credentials, and IPC inputs #2.