Skip to content

Commit 6df0657

Browse files
committed
fix(ui): keep aggregate deletes on safe default
1 parent bc4f994 commit 6df0657

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

.claude/rules/emcn-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The menu surface intentionally diverges from the pill: `dropdown-menu.tsx` items
3838
Declare keyboard intent on the action-owning primitive; never add document-level or per-callsite Enter listeners.
3939

4040
- `ChipModalFooter` defaults to `defaultAction='primary'`. A plain Enter in a canonical single-line field or a custom plain input invokes the enabled primary action. Use `'none'` when submission must require an explicit click, such as an irreversible destructive action or an editor whose nested control owns Enter. Use `'dismiss'` only when dismissal is genuinely the modal's default decision.
41-
- `ChipConfirmModal` fails safe with `defaultAction='dismiss'`. Opt into `'confirm'` only for an audited, reversible or non-destructive decision. Use `'none'` for typed confirmations and severe account, ownership, or access changes. Button color never determines keyboard behavior.
41+
- `ChipConfirmModal` fails safe with `defaultAction='dismiss'`. Opt into `'confirm'` only for an audited, low-impact reversible or non-destructive decision. Deleting an aggregate resource such as a workflow, table, knowledge base, or folder remains `'dismiss'` even when it can be restored, because the action takes a broad dependent graph offline. Use `'none'` for typed confirmations and severe account, ownership, or access changes. Button color never determines keyboard behavior.
4242
- Textareas, native forms, buttons, links, comboboxes, menus, listboxes, tag/email inputs, IME composition, modified Enter, and disabled or pending actions retain their native behavior. A native form remains the sole submission path so browser validation is not bypassed.
4343
- A custom field containing a search, token editor, or another input that owns Enter must set `submitOnEnter={false}` on `ChipModalField`. Do not attach a duplicate `onKeyDown` handler merely to call the footer action.
4444
- Initial focus goes to the first visible editable text control. With no text control, the declared real button receives focus; `'none'` focuses the dialog surface. A safe dismiss default never turns Enter in a text field into data loss—the field simply does not publish a submit action.

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ export function KnowledgeBase({
13721372
onOpenChange={setShowDeleteDialog}
13731373
srTitle='Delete Knowledge Base'
13741374
title='Delete Knowledge Base'
1375-
defaultAction='confirm'
1375+
defaultAction='dismiss'
13761376
text={[
13771377
'Are you sure you want to delete ',
13781378
{ text: knowledgeBaseName, bold: true },

apps/sim/app/workspace/[workspaceId]/knowledge/components/delete-knowledge-base-modal/delete-knowledge-base-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const DeleteKnowledgeBaseModal = memo(function DeleteKnowledgeBaseModal({
4343
onOpenChange={onClose}
4444
srTitle='Delete Knowledge Base'
4545
title='Delete Knowledge Base'
46-
defaultAction='confirm'
46+
defaultAction='dismiss'
4747
text={
4848
knowledgeBaseName
4949
? [

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,7 @@ export function Table({
18241824
onOpenChange={setShowDeleteTableConfirm}
18251825
srTitle='Delete Table'
18261826
title='Delete Table'
1827-
defaultAction='confirm'
1827+
defaultAction='dismiss'
18281828
text={[
18291829
'Are you sure you want to delete ',
18301830
{ text: tableData?.name ?? 'this table', bold: true },

apps/sim/app/workspace/[workspaceId]/tables/tables.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ export function Tables() {
14411441
}}
14421442
srTitle='Delete Table'
14431443
title='Delete Table'
1444-
defaultAction='confirm'
1444+
defaultAction='dismiss'
14451445
text={[
14461446
'Are you sure you want to delete ',
14471447
{ text: activeTable?.name ?? 'this table', bold: true },

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ export const Panel = memo(function Panel() {
990990
onOpenChange={setIsDeleteModalOpen}
991991
srTitle='Delete Workflow'
992992
title='Delete Workflow'
993-
defaultAction='confirm'
993+
defaultAction='dismiss'
994994
text={[
995995
'Are you sure you want to delete ',
996996
{ text: currentWorkflow?.name ?? 'this workflow', bold: true },

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/delete-modal/delete-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function DeleteModal({
7070
const isConfirmed = !isWorkspace || confirmationText === workspaceName
7171
const defaultAction = isWorkspace
7272
? 'none'
73-
: isSingle && (itemType === 'workflow' || itemType === 'task')
73+
: isSingle && itemType === 'task'
7474
? 'confirm'
7575
: 'dismiss'
7676

0 commit comments

Comments
 (0)