Repository navigation
test(studio): fix sidebar viewport contamination flake - #2609
Merged
Merged
Conversation
jbeda
enabled auto-merge (squash)
October 29, 2026 18:31
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
force-pushed
the
fix/studio-sidebar-viewport-flake
branch
from
October 29, 2026 18:36
a7ac742 to
d63e94b
Compare
Merged
2 tasks
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
Fixes #2603.
innerWidth,innerHeight, andmatchMediacentrally between Studio tests. Vitest usesisolate: false, so direct viewport patches otherwise survive into later files and turn the sidebar's expected desktop submenu into its mobile inline folder group.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:
src/components/ui/option-field.test.tsxsrc/features/chat/chat-composer.configuration.test.tsxsrc/features/chat/session-sidebar.pinning.test.tsxBefore 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
task test,task lint, andtask test:racepassed.go run ./cmd/mecademopassed, including tool call, permission ask/approval, and result.git diff --checkpassed.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.