Skip to content

Commit 3768c63

Browse files
authored
feat(readme): added deepwiki to readme, consolidated utils (#2856)
* feat(readme): added deepwiki to readme, consolidated utils * standardized all modals * updated modal copy * standardized modals * streamlined all error msg patterns
1 parent aa80116 commit 3768c63

File tree

49 files changed

+307
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+307
-196
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="https://sim.ai" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/sim.ai-6F3DFA" alt="Sim.ai"></a>
1111
<a href="https://discord.gg/Hr4UWYEcTT" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/Discord-Join%20Server-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
1212
<a href="https://x.com/simdotai" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/twitter/follow/simstudioai?style=social" alt="Twitter"></a>
13-
<a href="https://docs.sim.ai" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/Docs-6F3DFA.svg" alt="Documentation"></a>
13+
<a href="https://docs.sim.ai" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/Docs-6F3DFA.svg" alt="Documentation"></a> <a href="https://deepwiki.com/simstudioai/sim" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/DeepWiki-1E90FF.svg" alt="DeepWiki"></a>
1414
</p>
1515

1616
<p align="center">

apps/sim/app/api/form/[identifier]/route.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { preprocessExecution } from '@/lib/execution/preprocessing'
1111
import { LoggingSession } from '@/lib/logs/execution/logging-session'
1212
import { normalizeInputFormatValue } from '@/lib/workflows/input-format'
1313
import { createStreamingResponse } from '@/lib/workflows/streaming/streaming'
14+
import { isValidStartBlockType } from '@/lib/workflows/triggers/start-block-types'
1415
import { setFormAuthCookie, validateFormAuth } from '@/app/api/form/utils'
1516
import { createErrorResponse, createSuccessResponse } from '@/app/api/workflows/utils'
1617

@@ -35,10 +36,7 @@ async function getWorkflowInputSchema(workflowId: string): Promise<any[]> {
3536
.from(workflowBlocks)
3637
.where(eq(workflowBlocks.workflowId, workflowId))
3738

38-
const startBlock = blocks.find(
39-
(block) =>
40-
block.type === 'starter' || block.type === 'start_trigger' || block.type === 'input_trigger'
41-
)
39+
const startBlock = blocks.find((block) => isValidStartBlockType(block.type))
4240

4341
if (!startBlock) {
4442
return []

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function DeleteChunkModal({
7777
</p>
7878
</ModalBody>
7979
<ModalFooter>
80-
<Button variant='active' disabled={isDeleting} onClick={onClose}>
80+
<Button variant='default' disabled={isDeleting} onClick={onClose}>
8181
Cancel
8282
</Button>
8383
<Button variant='destructive' onClick={handleDeleteChunk} disabled={isDeleting}>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ export function DocumentTagsModal({
392392

393393
return (
394394
<Modal open={open} onOpenChange={handleClose}>
395-
<ModalContent>
395+
<ModalContent size='sm'>
396396
<ModalHeader>
397397
<div className='flex items-center justify-between'>
398398
<span>Document Tags</span>
@@ -486,7 +486,7 @@ export function DocumentTagsModal({
486486
/>
487487
)}
488488
{tagNameConflict && (
489-
<span className='text-[11px] text-[var(--text-error)]'>
489+
<span className='text-[12px] text-[var(--text-error)]'>
490490
A tag with this name already exists
491491
</span>
492492
)}
@@ -639,7 +639,7 @@ export function DocumentTagsModal({
639639
/>
640640
)}
641641
{tagNameConflict && (
642-
<span className='text-[11px] text-[var(--text-error)]'>
642+
<span className='text-[12px] text-[var(--text-error)]'>
643643
A tag with this name already exists
644644
</span>
645645
)}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,15 +1161,19 @@ export function Document({
11611161
<ModalHeader>Delete Document</ModalHeader>
11621162
<ModalBody>
11631163
<p className='text-[12px] text-[var(--text-secondary)]'>
1164-
Are you sure you want to delete "{effectiveDocumentName}"? This will permanently
1165-
delete the document and all {documentData?.chunkCount ?? 0} chunk
1164+
Are you sure you want to delete{' '}
1165+
<span className='font-medium text-[var(--text-primary)]'>
1166+
{effectiveDocumentName}
1167+
</span>
1168+
? This will permanently delete the document and all {documentData?.chunkCount ?? 0}{' '}
1169+
chunk
11661170
{documentData?.chunkCount === 1 ? '' : 's'} within it.{' '}
11671171
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
11681172
</p>
11691173
</ModalBody>
11701174
<ModalFooter>
11711175
<Button
1172-
variant='active'
1176+
variant='default'
11731177
onClick={() => setShowDeleteDocumentDialog(false)}
11741178
disabled={isDeletingDocument}
11751179
>

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,15 +1523,16 @@ export function KnowledgeBase({
15231523
<ModalHeader>Delete Knowledge Base</ModalHeader>
15241524
<ModalBody>
15251525
<p className='text-[12px] text-[var(--text-secondary)]'>
1526-
Are you sure you want to delete "{knowledgeBaseName}"? This will permanently delete
1527-
the knowledge base and all {pagination.total} document
1526+
Are you sure you want to delete{' '}
1527+
<span className='font-medium text-[var(--text-primary)]'>{knowledgeBaseName}</span>?
1528+
This will permanently delete the knowledge base and all {pagination.total} document
15281529
{pagination.total === 1 ? '' : 's'} within it.{' '}
15291530
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
15301531
</p>
15311532
</ModalBody>
15321533
<ModalFooter>
15331534
<Button
1534-
variant='active'
1535+
variant='default'
15351536
onClick={() => setShowDeleteDialog(false)}
15361537
disabled={isDeleting}
15371538
>
@@ -1549,14 +1550,16 @@ export function KnowledgeBase({
15491550
<ModalHeader>Delete Document</ModalHeader>
15501551
<ModalBody>
15511552
<p className='text-[12px] text-[var(--text-secondary)]'>
1552-
Are you sure you want to delete "
1553-
{documents.find((doc) => doc.id === documentToDelete)?.filename ?? 'this document'}"?{' '}
1554-
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
1553+
Are you sure you want to delete{' '}
1554+
<span className='font-medium text-[var(--text-primary)]'>
1555+
{documents.find((doc) => doc.id === documentToDelete)?.filename ?? 'this document'}
1556+
</span>
1557+
? <span className='text-[var(--text-error)]'>This action cannot be undone.</span>
15551558
</p>
15561559
</ModalBody>
15571560
<ModalFooter>
15581561
<Button
1559-
variant='active'
1562+
variant='default'
15601563
onClick={() => {
15611564
setShowDeleteDocumentModal(false)
15621565
setDocumentToDelete(null)
@@ -1582,7 +1585,7 @@ export function KnowledgeBase({
15821585
</p>
15831586
</ModalBody>
15841587
<ModalFooter>
1585-
<Button variant='active' onClick={() => setShowBulkDeleteModal(false)}>
1588+
<Button variant='default' onClick={() => setShowBulkDeleteModal(false)}>
15861589
Cancel
15871590
</Button>
15881591
<Button variant='destructive' onClick={confirmBulkDelete} disabled={isBulkOperating}>

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-documents-modal/add-documents-modal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,14 @@ export function AddDocumentsModal({
221221

222222
return (
223223
<Modal open={open} onOpenChange={handleClose}>
224-
<ModalContent>
224+
<ModalContent size='md'>
225225
<ModalHeader>Add Documents</ModalHeader>
226226

227227
<ModalBody>
228228
<div className='min-h-0 flex-1 overflow-y-auto'>
229229
<div className='space-y-[12px]'>
230230
{fileError && (
231-
<p className='text-[11px] text-[var(--text-error)] leading-tight'>{fileError}</p>
231+
<p className='text-[12px] text-[var(--text-error)] leading-tight'>{fileError}</p>
232232
)}
233233

234234
<div className='flex flex-col gap-[8px]'>
@@ -336,7 +336,7 @@ export function AddDocumentsModal({
336336
<ModalFooter>
337337
<div className='flex w-full items-center justify-between gap-[12px]'>
338338
{uploadError ? (
339-
<p className='min-w-0 flex-1 truncate text-[11px] text-[var(--text-error)] leading-tight'>
339+
<p className='min-w-0 flex-1 truncate text-[12px] text-[var(--text-error)] leading-tight'>
340340
{uploadError.message}
341341
</p>
342342
) : (

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
306306
return (
307307
<>
308308
<Modal open={open} onOpenChange={handleClose}>
309-
<ModalContent>
309+
<ModalContent size='sm'>
310310
<ModalHeader>
311311
<div className='flex items-center justify-between'>
312312
<span>Tags</span>
@@ -400,7 +400,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
400400
}}
401401
/>
402402
{tagNameConflict && (
403-
<span className='text-[11px] text-[var(--text-error)]'>
403+
<span className='text-[12px] text-[var(--text-error)]'>
404404
A tag with this name already exists
405405
</span>
406406
)}
@@ -417,7 +417,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
417417
placeholder='Select type'
418418
/>
419419
{!hasAvailableSlots(createTagForm.fieldType) && (
420-
<span className='text-[11px] text-[var(--text-error)]'>
420+
<span className='text-[12px] text-[var(--text-error)]'>
421421
No available slots for this type. Choose a different type.
422422
</span>
423423
)}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function RenameDocumentModal({
7777

7878
return (
7979
<Modal open={open} onOpenChange={onOpenChange}>
80-
<ModalContent>
80+
<ModalContent size='sm'>
8181
<ModalHeader>Rename Document</ModalHeader>
8282
<form onSubmit={handleSubmit} className='flex min-h-0 flex-1 flex-col'>
8383
<ModalBody className='!pb-[16px]'>
@@ -108,7 +108,7 @@ export function RenameDocumentModal({
108108
<ModalFooter>
109109
<div className='flex w-full items-center justify-between gap-[12px]'>
110110
{error ? (
111-
<p className='min-w-0 flex-1 truncate text-[11px] text-[var(--text-error)] leading-tight'>
111+
<p className='min-w-0 flex-1 truncate text-[12px] text-[var(--text-error)] leading-tight'>
112112
{error}
113113
</p>
114114
) : (

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ export function CreateBaseModal({ open, onOpenChange }: CreateBaseModalProps) {
332332

333333
return (
334334
<Modal open={open} onOpenChange={handleClose}>
335-
<ModalContent>
335+
<ModalContent size='lg'>
336336
<ModalHeader>Create Knowledge Base</ModalHeader>
337337

338338
<form onSubmit={handleSubmit(onSubmit)} className='flex min-h-0 flex-1 flex-col'>
@@ -528,7 +528,7 @@ export function CreateBaseModal({ open, onOpenChange }: CreateBaseModalProps) {
528528
)}
529529

530530
{fileError && (
531-
<p className='text-[11px] text-[var(--text-error)] leading-tight'>{fileError}</p>
531+
<p className='text-[12px] text-[var(--text-error)] leading-tight'>{fileError}</p>
532532
)}
533533
</div>
534534
</div>
@@ -537,7 +537,7 @@ export function CreateBaseModal({ open, onOpenChange }: CreateBaseModalProps) {
537537
<ModalFooter>
538538
<div className='flex w-full items-center justify-between gap-[12px]'>
539539
{submitStatus?.type === 'error' || uploadError ? (
540-
<p className='min-w-0 flex-1 truncate text-[11px] text-[var(--text-error)] leading-tight'>
540+
<p className='min-w-0 flex-1 truncate text-[12px] text-[var(--text-error)] leading-tight'>
541541
{uploadError?.message || submitStatus?.message}
542542
</p>
543543
) : (

0 commit comments

Comments
 (0)