Skip to content

improvement(ui): standardize modal default actions - #7029

Merged
waleedlatif1 merged 2 commits into
stagingfrom
codex/modal-enter-default-actions
Aug 24, 2026
Merged

improvement(ui): standardize modal default actions#7029
waleedlatif1 merged 2 commits into
stagingfrom
codex/modal-enter-default-actions

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Standardize modal Enter behavior around explicit primary, dismiss, confirm, and no-default policies
  • Migrate remaining action and viewer dialogs onto canonical ChipModal composition
  • Preserve native form, textarea, combobox, tag editor, modifier-key, repeat-key, and IME behavior

Type of Change

  • Other: Improvement

Testing

  • bun run lint:check
  • bun run check:api-validation
  • bun run check:audits
  • bun run type-check in apps/sim and packages/emcn
  • 117 emcn tests and 3 snapshot boundary tests

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)

@vercel

vercel Bot commented Aug 24, 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 Aug 24, 2026 3:28am

Request Review

@cursor

cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Keyboard defaults for destructive and high-impact confirmations (delete, undeploy, account/ownership) now fail closed, so a mis-set defaultAction could submit or block Enter unexpectedly. Deploy modal composition and form-associated submit buttons also change interaction paths.

Overview
Chip modals now own Enter and initial focus through an explicit defaultAction on the footer (primary / dismiss / none), instead of per-field onSubmit listeners and a submit-context ref.

Confirmations fail safe to dismiss. Enter in a text field never fires a destructive confirm unless the call site opts into 'confirm' for a low-impact reversible action, or 'none' for typed/severe flows (account delete, ban, ownership transfer). Aggregate deletes (workflows, tables, knowledge bases, folders) stay on dismiss even when restore exists.

Remaining action/viewer dialogs (deploy, execution snapshot, expanded preview) compose with ChipModal/ChipModalFooter, including form-associated submit buttons and fullBleed bodies. Native forms, textareas, comboboxes, tag editors, IME, and modifier/repeat Enter keep their own behavior; custom fields that own Enter set submitOnEnter={false}.

Reviewed by Cursor Bugbot for commit 6df0657. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR standardizes modal keyboard defaults and migrates remaining dialogs to canonical ChipModal composition.

  • Aggregate workflow, table, folder, and knowledge-base deletions now default to dismissal.
  • Severe or typed-confirmation actions disable keyboard defaults, while audited low-impact actions may explicitly confirm.
  • Shared handling preserves forms, textareas, comboboxes, composition, modifier keys, and nested Enter-owning controls.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported destructive Enter behavior is no longer reachable for workflow, table, or knowledge-base deletion, and no blocking failure remains.

Important Files Changed

Filename Overview
packages/emcn/src/components/chip-modal/chip-modal.tsx Centralizes modal default-action focus and Enter routing while retaining native behavior for controls that own Enter.
packages/emcn/src/components/chip-modal/chip-modal.test.tsx Adds coverage for primary, dismiss, confirm, no-default, form, input, modifier-key, repeat-key, and composition boundaries.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx The workflow deletion dialog now explicitly defaults keyboard action to dismissal.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx Table and column deletion dialogs now explicitly default keyboard action to dismissal.
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx Knowledge-base deletion now explicitly defaults keyboard action to dismissal.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/delete-modal/delete-modal.tsx Sidebar deletion policy keeps aggregate resources on dismissal while allowing confirmation for a single task.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx Migrates deployment settings to ChipModal composition with tab-specific declarative footer actions.

Reviews (2): Last reviewed commit: "fix(ui): keep aggregate deletes on safe ..." | Re-trigger Greptile

@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 6df0657. Configure here.

@waleedlatif1
waleedlatif1 merged commit 82b02fb into staging Aug 24, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/modal-enter-default-actions branch August 24, 2026 07:43
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