🤖 fix: keep automation modal interactions local#3569
Conversation
Stop dialog content pointer, touch, mouse, and click events from bubbling through React portals into clickable workspace ancestors. This keeps mobile automation modal interactions from closing the modal unexpectedly. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `0.99`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=10.99 -->
Deduplicate DialogContent event wrappers with a typed stop-propagation helper while preserving consumer handler delegation order. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `0.99`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=10.99 -->
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08d6c8e727
ℹ️ 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".
Keep DialogContent pointerdown bubbling intact so Radix DismissableLayer can reset inside/outside tracking, while still stopping click, mouse, and touch events from leaking to React ancestors. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `6.18`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=16.18 -->
|
@codex review Please take another look after the pointerdown dismissal fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe156a6584
ℹ️ 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".
Keep DialogContent mouse events bubbling so native document mousedown outside-click listeners inside dialogs continue to work, while preserving mobile touch and click isolation. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `6.18`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=16.18 -->
|
@codex review Please take another look after the mousedown outside-click fix. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Move the automation modal mobile fix out of shared DialogContent and into the workspace row event handlers. This keeps native dialog/popover outside-click listeners working while preventing portal clicks and touches from selecting the row. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `6.18`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=16.18 -->
|
@codex review Please take another look after moving the fix out of shared DialogContent and into the workspace row portal-event guard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31b7b10c02
ℹ️ 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".
Guard workspace row context-menu handling for portal-rendered dialogs so right-clicks inside the automation modal do not open the workspace actions menu. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `6.18`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=16.18 -->
|
@codex review Please take another look after adding the portal guard to the row context-menu path. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Replace the flaky portalled AgentListItem integration test with focused coverage for dialog-target detection, while keeping the workspace row click, touch, and context-menu guards. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `6.18`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=16.18 -->
|
@codex review Please take another look after replacing the flaky portalled integration test with utility-level dialog target coverage while preserving the workspace row guards. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Fixes workspace automation modal interactions closing the modal unexpectedly on mobile by making workspace rows ignore events that originate from portal-rendered dialogs.
Background
React portals still bubble synthetic events through the React component tree. In the mobile workspace sidebar, the automation modal is rendered from within a workspace row. Taps or context-menu gestures inside that modal can bubble back to the row's click/touch/context-menu handlers, which can select the workspace, trigger row touch handling, or open the workspace actions menu over the modal.
Implementation
role="dialog"event targets and validates the affected workspace-row tests locally.simplifyworkflow (wfr_6e23a85b34378b24) and refined the implementation based on Codex feedback about preserving Radix/native outside-click behavior.Validation
bun test src/browser/utils/events.test.tsbun test src/browser/components/AgentListItem/AgentListItem.test.tsxbun test src/browser/components/AutomationModal/AutomationModal.test.tsxbun test src/browser/components/WorkspaceMenuBar/WorkspaceMenuBar.test.tsxmake fmt-checkmake typecheckMUX_ESLINT_CONCURRENCY=1 make static-checkRisks
Low. The behavior change is scoped to workspace row event handling and only ignores events whose DOM target is inside a
role="dialog"element. Dialog and popover internals keep native pointer/mouse propagation for outside-click tracking.Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$16.18