fix(web): close tool menus before opening the tool credentials dialog
Description
Part 6 of the ENG-4416 stack. With the tools menu and the hover-opened Plugins submenu open, clicking "Tools need credentials" opened the "Connect tools" dialog under both menus. Radix closes a popover on the outside click, but the dialog opened in the same click handler and trapped focus first, so the menus never got the dismiss. MCPConnectionPrompt now opens the dialog on the next task, after the menus close.
| Before | After (desktop) | After (mobile) |
|---|---|---|
How Has This Been Tested?
- Local ODS stack with a bearer-token MCP server that needs per-user credentials. Before the click both menus are
open; after it there are no popovers and one "Connect tools" dialog (desktop hover + mobile tap). - Also checked the submenu's own "Connect" button: menus close and the "Connect Wiki MCP" dialog opens.
- MCPConnectionPrompt suite: 11 passed.
pre-commiton touched files.
Additional Options
- [Optional] Please cherry-pick this PR to the latest release version.
Link to Devin session: https://app.devin.ai/sessions/09df74c24e19407bbf0e7ab775b5cb0a
Open in Devin Desktop: https://app.devin.ai/desktop/session/09df74c24e19407bbf0e7ab775b5cb0a?variant=devin
Requested by: @rohoswagger
Summary by cubic
Fixes the "Connect tools" dialog opening underneath the tools menu and the hover-opened Plugins submenu. Deferring the dialog open with window.setTimeout lets Radix dismiss the open popovers on the outside click before the dialog traps focus, so the dialogs no longer stack over the menus.
Summary by CodeRabbit
- Bug Fixes
- Improved the transition from open popovers to connection dialogs, ensuring popovers close before the dialog captures focus.