Skip to content

🤖 fix: keep automation modal interactions local#3569

Merged
ThomasK33 merged 7 commits into
mainfrom
automation-modal-mnf6
Jun 16, 2026
Merged

🤖 fix: keep automation modal interactions local#3569
ThomasK33 merged 7 commits into
mainfrom
automation-modal-mnf6

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Jun 16, 2026

Copy link
Copy Markdown
Member

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

  • Workspace rows now ignore click, double-click, touch, and context-menu events whose DOM target is inside a portal-rendered dialog.
  • Shared dialog content no longer stops propagation, so Radix/native document outside-click listeners for dialogs and popovers continue to receive pointer/mouse events.
  • Adds focused coverage for detecting role="dialog" event targets and validates the affected workspace-row tests locally.
  • Ran the project simplify workflow (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.ts
  • bun test src/browser/components/AgentListItem/AgentListItem.test.tsx
  • bun test src/browser/components/AutomationModal/AutomationModal.test.tsx
  • bun test src/browser/components/WorkspaceMenuBar/WorkspaceMenuBar.test.tsx
  • make fmt-check
  • make typecheck
  • MUX_ESLINT_CONCURRENCY=1 make static-check
  • Storybook dogfood at desktop and mobile widths: interacted with automation modal switch/input/textarea/select controls and confirmed the modal stayed open.

Risks

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

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 -->
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread src/browser/components/Dialog/Dialog.tsx Outdated
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 -->
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the pointerdown dismissal fix.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread src/browser/components/Dialog/Dialog.tsx Outdated
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 -->
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the mousedown outside-click fix.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 86b69956cb

ℹ️ 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".

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 -->
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after moving the fix out of shared DialogContent and into the workspace row portal-event guard.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread src/browser/components/AgentListItem/AgentListItem.tsx
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 -->
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after adding the portal guard to the row context-menu path.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 6374bfadbd

ℹ️ 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".

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 -->
@ThomasK33

Copy link
Copy Markdown
Member Author

@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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 1d39a15f78

ℹ️ 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".

@ThomasK33 ThomasK33 added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
@ThomasK33 ThomasK33 added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
@ThomasK33 ThomasK33 added this pull request to the merge queue Jun 16, 2026
Merged via the queue into main with commit 93c61ce Jun 16, 2026
40 of 42 checks passed
@ThomasK33 ThomasK33 deleted the automation-modal-mnf6 branch June 16, 2026 08:41
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