Skip to content

test(studio): fix sidebar viewport contamination flake - #2609

Merged
jbeda merged 1 commit into
mainfrom
fix/studio-sidebar-viewport-flake
Oct 29, 2026
Merged

jbeda merged 1 commit into
mainfrom
fix/studio-sidebar-viewport-flake

Conversation

@jbeda

@jbeda jbeda commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2603.

  • Restore shared innerWidth, innerHeight, and matchMedia centrally between Studio tests. Vitest uses isolate: false, so direct viewport patches otherwise survive into later files and turn the sidebar's expected desktop submenu into its mobile inline folder group.
  • Restore both property descriptors and accessor-held values: restoring a descriptor alone does not clear Vitest's cached assignment overrides.
  • Add an ordered direct-patch/restoration regression and real mobile inline-folder coverage, preserving the existing desktop folder-action test. No production UI changes or timeout increases.

Reproduction and regression evidence

Using Node 26.13.0 and workspace pnpm 12.15.0, run these files in a controlled single-worker, no-isolate order:

  1. src/components/ui/option-field.test.tsx
  2. src/features/chat/chat-composer.configuration.test.tsx
  3. src/features/chat/session-sidebar.pinning.test.tsx

Before the fix, this reproduces the exact CI error: Unable to find role="menuitem" and name "Move to folder". After the fix, the ordered run passes. Removing the reset makes both the new restoration regression and the original desktop sidebar test fail. Ten further ordered runs passed (21 tests per run, including the shared-setup regression file).

Verification

  • Full Studio suite: 201 web files / 1,766 tests and 27 server files / 255 tests passed.
  • Two additional complete web-suite runs with shuffled file order, seeds 2603 and 2604, passed.
  • Studio Biome and typecheck passed.
  • task test, task lint, and task test:race passed.
  • go run ./cmd/mecademo passed, including tool call, permission ask/approval, and result.
  • git diff --check passed.
  • Spec, Standards, independent Test adequacy, and Domain review axes found no issues.

API compatibility

Test-only change. No production behavior, wire/API contracts, Go source APIs, or stored-data formats change. No major-version or feature-identifier changes; no upgrade steps required.

Fix the order-dependent sidebar folder-menu failure by restoring viewport dimensions and matchMedia centrally, including Vitest accessor-held overrides. Add reset and mobile folder-menu regressions.

Fixes #2603

Co-authored-by: Mecatl <[email protected]>
@jbeda
jbeda force-pushed the fix/studio-sidebar-viewport-flake branch from a7ac742 to d63e94b Compare October 29, 2026 18:36
@jbeda
jbeda merged commit 1d40f68 into main Oct 29, 2026
35 checks passed
@jbeda
jbeda deleted the fix/studio-sidebar-viewport-flake branch October 29, 2026 18:43
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Nov 18, 2026
2 tasks
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.

flake(studio): sidebar folder action intermittently misses desktop Move to folder menuitem

1 participant