Skip to content

Commit fd29a29

Browse files
waleedlatif1claude
andcommitted
fix(modals): consistent text colors, copy, and workspace delete confirmation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5c7b057 commit fd29a29

File tree

33 files changed

+108
-103
lines changed

33 files changed

+108
-103
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,10 +1232,8 @@ const DeleteConfirmModal = memo(function DeleteConfirmModal({
12321232
<ModalBody>
12331233
<p className='text-[var(--text-secondary)]'>
12341234
Are you sure you want to delete{' '}
1235-
<span className='font-medium text-[var(--text-primary)]'>{fileName}</span>?{' '}
1236-
<span className='text-[var(--text-tertiary)]'>
1237-
You can restore it from Recently Deleted in Settings.
1238-
</span>
1235+
<span className='font-medium text-[var(--text-primary)]'>{fileName}</span>? You can
1236+
restore it from Recently Deleted in Settings.
12391237
</p>
12401238
</ModalBody>
12411239
<ModalFooter>

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/components/delete-chunk-modal/delete-chunk-modal.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ export function DeleteChunkModal({
3535
<ModalHeader>Delete Chunk</ModalHeader>
3636
<ModalBody>
3737
<p className='text-[var(--text-secondary)]'>
38-
Are you sure you want to delete this chunk?{' '}
39-
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
38+
Are you sure you want to delete this chunk? This action cannot be undone.
4039
</p>
4140
</ModalBody>
4241
<ModalFooter>

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/components/document-tags-modal/document-tags-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ export function DocumentTagsModal({
383383

384384
return (
385385
<Modal open={open} onOpenChange={handleClose}>
386-
<ModalContent size='md'>
386+
<ModalContent size='sm'>
387387
<ModalHeader>
388388
<div className='flex items-center justify-between'>
389389
<span>Document Tags</span>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ export function Document({
11871187
from future syncs. To temporarily hide it from search, disable it instead.
11881188
</span>
11891189
) : (
1190-
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
1190+
<>This action cannot be undone.</>
11911191
)}
11921192
</p>
11931193
</ModalBody>

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,9 +1182,7 @@ export function KnowledgeBase({
11821182
The knowledge base and all {pagination.total} document
11831183
{pagination.total === 1 ? '' : 's'} within it will be removed.
11841184
</span>{' '}
1185-
<span className='text-[var(--text-tertiary)]'>
1186-
You can restore it from Recently Deleted in Settings.
1187-
</span>
1185+
You can restore it from Recently Deleted in Settings.
11881186
</p>
11891187
</ModalBody>
11901188
<ModalFooter>
@@ -1221,9 +1219,12 @@ export function KnowledgeBase({
12211219
it from future syncs. To temporarily hide it from search, disable it instead.
12221220
</span>
12231221
) : (
1224-
<span className='text-[var(--text-error)]'>
1225-
This will permanently delete the document.
1226-
</span>
1222+
<>
1223+
<span className='text-[var(--text-error)]'>
1224+
This will permanently delete the document.
1225+
</span>{' '}
1226+
This action cannot be undone.
1227+
</>
12271228
)}
12281229
</p>
12291230
)
@@ -1256,7 +1257,8 @@ export function KnowledgeBase({
12561257
<span className='text-[var(--text-error)]'>
12571258
This will permanently delete the selected document
12581259
{selectedDocuments.size === 1 ? '' : 's'}.
1259-
</span>
1260+
</span>{' '}
1261+
This action cannot be undone.
12601262
</p>
12611263
</ModalBody>
12621264
<ModalFooter>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
261261
return (
262262
<>
263263
<Modal open={open} onOpenChange={handleClose}>
264-
<ModalContent size='md'>
264+
<ModalContent size='sm'>
265265
<ModalHeader>
266266
<div className='flex items-center justify-between'>
267267
<span>Tags</span>
@@ -421,7 +421,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
421421
This will remove this tag from {selectedTagUsage?.documentCount || 0} document
422422
{selectedTagUsage?.documentCount !== 1 ? 's' : ''}.
423423
</span>{' '}
424-
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
424+
This action cannot be undone.
425425
</p>
426426

427427
{selectedTagUsage && selectedTagUsage.documentCount > 0 && (

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

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useCallback, useRef, useState } from 'react'
3+
import { useCallback, useState } from 'react'
44
import { useParams, useRouter } from 'next/navigation'
55
import { Badge, DocumentAttachment, Tooltip } from '@/components/emcn'
66
import { formatAbsoluteDate, formatRelativeTime } from '@/lib/core/utils/formatting'
@@ -101,23 +101,6 @@ export function BaseCard({
101101
const [isTagsModalOpen, setIsTagsModalOpen] = useState(false)
102102
const [isDeleting, setIsDeleting] = useState(false)
103103

104-
/**
105-
* Guards against context menu actions triggering card navigation.
106-
* The card's onClick fires synchronously during the click event bubble phase,
107-
* so the ref is checked before the setTimeout-0 callback resets it.
108-
*/
109-
const actionTakenRef = useRef(false)
110-
const withActionGuard = useCallback((fn: () => void) => {
111-
actionTakenRef.current = true
112-
try {
113-
fn()
114-
} finally {
115-
setTimeout(() => {
116-
actionTakenRef.current = false
117-
}, 0)
118-
}
119-
}, [])
120-
121104
const searchParams = new URLSearchParams({
122105
kbName: title,
123106
})
@@ -127,7 +110,7 @@ export function BaseCard({
127110

128111
const handleClick = useCallback(
129112
(e: React.MouseEvent) => {
130-
if (isContextMenuOpen || actionTakenRef.current) {
113+
if (isContextMenuOpen) {
131114
e.preventDefault()
132115
return
133116
}
@@ -147,25 +130,20 @@ export function BaseCard({
147130
)
148131

149132
const handleOpenInNewTab = useCallback(() => {
150-
withActionGuard(() => window.open(href, '_blank'))
151-
}, [href, withActionGuard])
133+
window.open(href, '_blank')
134+
}, [href])
152135

153136
const handleViewTags = useCallback(() => {
154-
withActionGuard(() => setIsTagsModalOpen(true))
155-
}, [withActionGuard])
137+
setIsTagsModalOpen(true)
138+
}, [])
156139

157140
const handleEdit = useCallback(() => {
158-
withActionGuard(() => setIsEditModalOpen(true))
159-
}, [withActionGuard])
141+
setIsEditModalOpen(true)
142+
}, [])
160143

161144
const handleDelete = useCallback(() => {
162-
withActionGuard(() => setIsDeleteModalOpen(true))
163-
}, [withActionGuard])
164-
165-
const handleCopyId = useCallback(() => {
166-
if (!id) return
167-
withActionGuard(() => navigator.clipboard.writeText(id))
168-
}, [id, withActionGuard])
145+
setIsDeleteModalOpen(true)
146+
}, [])
169147

170148
const handleConfirmDelete = useCallback(async () => {
171149
if (!id || !onDelete) return
@@ -262,7 +240,7 @@ export function BaseCard({
262240
onClose={closeContextMenu}
263241
onOpenInNewTab={handleOpenInNewTab}
264242
onViewTags={handleViewTags}
265-
onCopyId={id ? handleCopyId : undefined}
243+
onCopyId={id ? () => navigator.clipboard.writeText(id) : undefined}
266244
onEdit={handleEdit}
267245
onDelete={handleDelete}
268246
showOpenInNewTab={true}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ export const DeleteKnowledgeBaseModal = memo(function DeleteKnowledgeBaseModal({
5959
</span>
6060
</>
6161
)}{' '}
62-
<span className='text-[var(--text-tertiary)]'>
63-
You can restore it from Recently Deleted in Settings.
64-
</span>
62+
You can restore it from Recently Deleted in Settings.
6563
</p>
6664
</ModalBody>
6765
<ModalFooter>

apps/sim/app/workspace/[workspaceId]/logs/components/logs-toolbar/components/notifications/notifications.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,11 +1267,11 @@ export const NotificationSettings = memo(function NotificationSettings({
12671267
<ModalContent size='sm'>
12681268
<ModalHeader>Delete Notification</ModalHeader>
12691269
<ModalBody>
1270-
<p className='text-[var(--text-secondary)] text-caption'>
1270+
<p className='text-[var(--text-secondary)]'>
12711271
<span className='text-[var(--text-error)]'>
12721272
This will permanently remove the notification and stop all deliveries.
12731273
</span>{' '}
1274-
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
1274+
This action cannot be undone.
12751275
</p>
12761276
</ModalBody>
12771277
<ModalFooter>

apps/sim/app/workspace/[workspaceId]/scheduled-tasks/scheduled-tasks.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,12 @@ export function ScheduledTasks() {
447447
<ModalContent size='sm'>
448448
<ModalHeader>Delete Scheduled Task</ModalHeader>
449449
<ModalBody>
450-
<p className='text-[var(--text-secondary)] text-caption'>
450+
<p className='text-[var(--text-secondary)]'>
451451
Are you sure you want to delete{' '}
452452
<span className='font-medium text-[var(--text-primary)]'>
453453
{activeTask?.jobTitle || 'this task'}
454454
</span>
455-
? <span className='text-[var(--text-error)]'>This action cannot be undone.</span>
455+
? This action cannot be undone.
456456
</p>
457457
</ModalBody>
458458
<ModalFooter>

0 commit comments

Comments
 (0)