Skip to content

fix(deps): dedupe radix focus-scope/dismissable-layer so in-modal dropdowns open#4977

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/radix-in-modal-dropdown-dedupe
Jun 11, 2026
Merged

fix(deps): dedupe radix focus-scope/dismissable-layer so in-modal dropdowns open#4977
waleedlatif1 merged 2 commits into
stagingfrom
fix/radix-in-modal-dropdown-dedupe

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause of the credential "Add people" role dropdown not opening in production: the bundle contained two copies of Radix's coordination singletons. @radix-ui/react-dropdown-menu was the only Radix package pinned exactly (2.1.16), so when the lockfile refreshed in improvement(mothership): v0.2 #4923, react-dialog moved to focus-scope@1.1.9 + dismissable-layer@1.1.12 while react-menu stayed on 1.1.7/1.1.11
  • With two copies, a menu portaled out of a modal registers in the wrong focusScopesStack, so the dialog's focus trap never pauses, yanks focus back as the menu opens, and the menu's dismiss layer unmounts it in the same tick — the dropdown never appears. Stale local installs (single shared copy via react-dialog@1.1.15) keep working, which is why this only reproduced on fresh-install/production builds
  • The earlier z-index fix (improvement(mothership): smooth streamed text reveal + dropdown z-index fix #4947) didn't help because ChipDropdown was already on the popover layer — z-index was never the cause
  • Fix: bump @radix-ui/react-dropdown-menu to 2.1.17, whose react-menu pins the same internals batch as react-dialog@1.1.16. Verified every coordination package (dismissable-layer, focus-scope, focus-guards, portal, popper, presence) now resolves to a single version tree-wide

Type of Change

  • Bug fix

Testing

  • Verified via clean bun install that the duplicate dismissable-layer/focus-scope copies existed before and resolve to single versions after
  • Reproduced end-to-end in Chromium (Playwright) with a minimal modal-Dialog + non-modal DropdownMenu page: with dialog@1.1.16 + dropdown-menu@2.1.16 (the shipped pair) the menu fires open→close in the same tick and never renders; with dropdown-menu@2.1.17 it opens, items select, and it closes cleanly

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…pdowns open

@radix-ui/react-dropdown-menu was the only Radix package pinned exactly
(2.1.16), so the v0.7.0 lockfile refresh left its react-menu on
focus-scope@1.1.7 + dismissable-layer@1.1.11 while react-dialog@1.1.16
moved to focus-scope@1.1.9 + dismissable-layer@1.1.12. These packages
coordinate modal/popper interplay through module-scoped singletons
(focusScopesStack, layersWithOutsidePointerEventsDisabled); with two
copies in the bundle, a dialog's focus trap never pauses for a menu
portaled outside it and yanks focus back as the menu opens, so the
menu's dismiss layer unmounts it in the same tick. Symptom: ChipDropdown
menus inside ChipModal (e.g. the credential Add People role dropdown)
never appear in fresh-install/production builds while stale local
installs with a single shared copy keep working.

Bump dropdown-menu to 2.1.17, whose react-menu pins the same internals
batch as dialog 1.1.16 — every coordination package (dismissable-layer,
focus-scope, focus-guards, portal, popper, presence) now resolves to a
single version tree-wide.
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 11, 2026 7:46pm

Request Review

@cursor

cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Dependency-only patch bump with lockfile churn; low risk aside from verifying dropdown-in-dialog behavior in UI smoke tests.

Overview
Bumps @radix-ui/react-dropdown-menu in apps/sim from pinned 2.1.16 to ^2.1.17 and refreshes bun.lock so Radix’s shared internals (react-menu, focus-scope, dismissable-layer, etc.) align with react-dialog.

That dedupes the focus/dismiss coordination singletons that were split across two versions after a prior lockfile refresh. Dropdowns inside modals (e.g. credential “Add people” role) were opening and closing in the same tick in production because the menu registered on the wrong focus stack; this dependency alignment is the fix. No application source changes.

Reviewed by Cursor Bugbot for commit b746787. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes a production-only bug where in-modal dropdowns (e.g. the credential "Add people" role dropdown) never rendered because the bundle contained two copies of Radix's focus-scope and dismissable-layer coordination singletons. Bumps @radix-ui/react-dropdown-menu from the exact-pinned 2.1.16 to ^2.1.17 and also relaxes the pin to a caret range.

  • react-menu@2.1.17 now pulls the same dismissable-layer@1.1.12 and focus-scope@1.1.9 that react-dialog uses, so both packages share a single module instance and the focusScopesStack singleton behaves correctly.
  • The lockfile deduplication is confirmed: ~16 nested private dependency entries for the old react-menu@2.1.16 subtree are removed, and the shared top-level entries remain.

Confidence Score: 5/5

Safe to merge — a minimal, well-diagnosed dependency bump that resolves a confirmed production regression with no application code changes.

The change is a single version bump in package.json plus the resulting lockfile deduplication. The root cause (duplicate coordination singletons from a mismatched exact pin) is clearly documented, the fix is targeted and verified, and the lockfile confirms all shared Radix internals now resolve to one copy. No application code is touched.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/package.json Bumps @radix-ui/react-dropdown-menu from exact-pinned 2.1.16 to caret-ranged ^2.1.17, aligning it with the rest of the Radix family and fixing the singleton deduplication issue.
bun.lock Lockfile reflects the version bump and removes ~16 nested private dependency entries for react-menu and react-dropdown-menu; all coordination singletons (dismissable-layer@1.1.12, focus-scope@1.1.9) now resolve to a single shared copy.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before["Before (broken — two singleton copies)"]
        RD["react-dialog@1.1.16"]
        RM16["react-menu@2.1.16"]
        FS_new["focus-scope@1.1.9 (dialog's copy)"]
        DL_new["dismissable-layer@1.1.12 (dialog's copy)"]
        FS_old["focus-scope@1.1.7 (menu's private copy)"]
        DL_old["dismissable-layer@1.1.11 (menu's private copy)"]
        RD --> FS_new
        RD --> DL_new
        RM16 --> FS_old
        RM16 --> DL_old
        FS_new -. "different module instance" .-> FS_old
        BUG["❌ focusScopesStack mismatch → menu unmounts immediately"]
        FS_old --> BUG
    end

    subgraph After["After (fixed — single shared copy)"]
        RD2["react-dialog@1.1.16"]
        RM17["react-menu@2.1.17"]
        FS_shared["focus-scope@1.1.9 (shared)"]
        DL_shared["dismissable-layer@1.1.12 (shared)"]
        RD2 --> FS_shared
        RD2 --> DL_shared
        RM17 --> FS_shared
        RM17 --> DL_shared
        OK["✅ Shared singleton → focus trap pauses correctly → dropdown opens"]
        FS_shared --> OK
    end
Loading

Reviews (2): Last reviewed commit: "fix(deps): use caret range for dropdown-..." | Re-trigger Greptile

Comment thread apps/sim/package.json Outdated
… the same batch

Address review: the exact pin was the original divergence mechanism, and
the rest of the radix popper/dialog family floats on caret ranges that
jump to the same internals batch together on lockfile refreshes.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b746787. Configure here.

@waleedlatif1 waleedlatif1 merged commit b465a3c into staging Jun 11, 2026
15 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/radix-in-modal-dropdown-dedupe branch June 11, 2026 20:55
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