Skip to content

fix(platform): keep sandbox row menus open and settle the connect audit - #4961

Merged
yannickmonney merged 2 commits into
mainfrom
fix/sandbox-menu-and-connect-audit
Oct 13, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/sandbox-menu-and-connect-audit

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Two heavy-tier failures that red main and every merge group, both from tests that landed without the heavy tier running. Both fail only on a loaded runner; each is reproduced locally and fixed.

Sandbox row menu closes under a re-render (sandboxes-settings.stop-task.test.tsx, from #4263; UI shard 3/4 failed about half the runs, in fr mostly, last in the queue). useBackendAction returns the raw useMutation result, which React Query v5 rebuilds on every render ({ ...result, mutate, mutateAsync: result.mutate }). The table's column memo depended on stop and setPinned, so every render produced new column definitions, and TanStack renders a cell function as a component type: every cell remounted, an open row menu closed and focus went to the page. In the suite the reconcile request settles just after the menu opens. A probe on a copy of the test showed the trigger node gone (connected=false, focus on body) right after aria-expanded turned true. This is also real behaviour: an admin's open row menu closes whenever the page re-renders. The columns now depend on the stable mutateAsync triggers, and the suite's query mock returns one identity per read, as the cache's data does.

Connect dialog audit (connect-agent-dialog.browser.test.tsx, from #4958; Browser job, "connected" case, both themes). The audit starts a few frames into the dialog's fade-in: axe skips a fully transparent element and fails a nearly transparent one, so CI read the text at a few percent (1.07:1). Locally axe starts at the first frame and passes. The test now waits for the animations that end (the waiting dot pulses for good).

Verified:

  • Twelve copies of the stop-task file run at once: before 0 of 12 pass, after 12 of 12. All 130 tests in settings/sandboxes pass, plus the stop-task browser file (15).
  • Connect audit with the fade stretched to 1.5 s and axe started 60 ms in: the old test fails all four audit cases with the CI reading (1.03:1); the new one passes them, and the whole file passes (18).
  • oxlint clean on the touched files. A sweep of app/ finds no other column memo that depends on a mutation object.

Not run locally: the full bun run check and the heavy tier (the PR's fast tier and the merge group run them).

useMutation returns a new object on every render, and the table's column
definitions depended on those objects. TanStack renders a cell function as
a component type, so a new definition remounted every cell: an open row
menu closed and focus went to the page whenever the component re-rendered,
for instance when the reconcile request settled just after the menu opened.

The columns now depend on the stable async triggers.

The stop-task suite hit it on loaded runners: it failed about half the
runs of UI shard 3/4 in CI, and 12 of 12 when twelve copies ran at once
locally (the trigger was gone from the page, the menu never opened). Its
query mock also built new data on every call, which a cache never does;
each read now keeps one identity. The same twelve copies pass.
axe skips a fully transparent dialog and fails a nearly transparent one.
CI starts the audit a few frames into the dialog's fade, so it judged the
text at a few percent (1.07:1) in the connected case, in both themes.
Locally the audit starts at the first frame and passes.

With the fade stretched and the audit started 60 ms in, the old test
fails all four cases with the same reading. Wait for the animations that
end; the waiting dot pulses for good and would never settle.
@yannickmonney
yannickmonney merged commit 6d420f6 into main Oct 13, 2026
@yannickmonney
yannickmonney deleted the fix/sandbox-menu-and-connect-audit branch October 13, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant