Skip to content

Studio frontend test: find the More flyout by its props in any order - #12356

Merged
danielhanchen merged 1 commit into
mainfrom
fix/more-flyout-gap-test
Sep 30, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/more-flyout-gap-test

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Frontend unit tests is red on main since #12339 (merged 2026-09-30), at tests/more-menu-separator-gap.test.ts:

could not find the More flyout's DropdownMenuContent

Cause

The test finds the sidebar More flyout with a regex that requires its props in one fixed order:

<DropdownMenuContent\s+side="right"\s+align="start"\s+sideOffset=\{6\}\s+className="..."

#12339 added ref={moreContentRef} as the first prop (plus hover handlers) so the menu can open on hover. After that the regex no longer matches. The flyout itself is unchanged in what the test checks: p-1 on the menu and my-1! on its rule, 4 px each. The product change is fine; the lookup was brittle.

The same regex also took the first mx-1! separator anywhere in app-sidebar.tsx. There is now a second one in another menu (my-2.5!), so a reorder could have compared the wrong rule.

Fix

  • The test walks every <DropdownMenuContent opening tag and picks the one with side="right", align="start" and sideOffset={6}, in any order.
  • The rule is read from inside that flyout, up to its </DropdownMenuContent>.
  • The assertion itself is unchanged: the rule's vertical margin must equal the menu's padding.

Testing

node --experimental-strip-types --test tests/more-menu-separator-gap.test.ts:

app-sidebar.tsx Result
main passes (fails before this change)
before #12339 passes
main with the flyout rule at my-2.5! fails on the spacing check
main with the flyout at p-2 fails on the spacing check

Test-only change.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T13:29:31.586063Z c9d71fe Manual request
🔒 Security Review ⚠️ Failed 2026-09-30T13:26:11.622699Z c9d71fe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c9d71fe132

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit a61240a into main Sep 30, 2026
31 of 36 checks passed
@danielhanchen
danielhanchen deleted the fix/more-flyout-gap-test branch September 30, 2026 13:59
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