Skip to content

Commit bb4c470

Browse files
committed
improvement(emcn): modal padding, api, chat, form
1 parent 51f9380 commit bb4c470

File tree

18 files changed

+380
-263
lines changed

18 files changed

+380
-263
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function CreateChunkModal({
123123
<ModalHeader>Create Chunk</ModalHeader>
124124

125125
<form>
126-
<ModalBody className='!pb-[16px]'>
126+
<ModalBody>
127127
<div className='flex flex-col gap-[8px]'>
128128
{error && <p className='text-[12px] text-[var(--text-error)]'>{error}</p>}
129129

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
@@ -399,7 +399,7 @@ export function DocumentTagsModal({
399399
</div>
400400
</ModalHeader>
401401

402-
<ModalBody className='!pb-[16px]'>
402+
<ModalBody>
403403
<div className='min-h-0 flex-1 overflow-y-auto'>
404404
<div className='space-y-[8px]'>
405405
<Label>Tags</Label>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export function EditChunkModal({
260260
</ModalHeader>
261261

262262
<form>
263-
<ModalBody className='!pb-[16px]'>
263+
<ModalBody>
264264
<div className='flex flex-col gap-[8px]'>
265265
{error && <p className='text-[12px] text-[var(--text-error)]'>{error}</p>}
266266

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
@@ -224,7 +224,7 @@ export function AddDocumentsModal({
224224
<ModalContent>
225225
<ModalHeader>Add Documents</ModalHeader>
226226

227-
<ModalBody className='!pb-[16px]'>
227+
<ModalBody>
228228
<div className='min-h-0 flex-1 overflow-y-auto'>
229229
<div className='space-y-[12px]'>
230230
{fileError && (
@@ -242,8 +242,8 @@ export function AddDocumentsModal({
242242
onDragLeave={handleDragLeave}
243243
onDrop={handleDrop}
244244
className={cn(
245-
'!bg-[var(--surface-1)] hover:!bg-[var(--surface-4)] w-full justify-center border border-[var(--c-575757)] border-dashed py-[10px]',
246-
isDragging && 'border-[var(--brand-primary-hex)]'
245+
'!bg-[var(--surface-1)] hover:!bg-[var(--surface-4)] w-full justify-center border border-[var(--border-1)] border-dashed py-[10px]',
246+
isDragging && 'border-[var(--surface-7)]'
247247
)}
248248
>
249249
<input

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
@@ -313,7 +313,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
313313
</div>
314314
</ModalHeader>
315315

316-
<ModalBody className='!pb-[16px]'>
316+
<ModalBody>
317317
<div className='min-h-0 flex-1 overflow-y-auto'>
318318
<div className='space-y-[8px]'>
319319
<Label>
@@ -458,7 +458,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
458458
<Modal open={deleteTagDialogOpen} onOpenChange={setDeleteTagDialogOpen}>
459459
<ModalContent size='sm'>
460460
<ModalHeader>Delete Tag</ModalHeader>
461-
<ModalBody className='!pb-[16px]'>
461+
<ModalBody>
462462
<div className='space-y-[8px]'>
463463
<p className='text-[12px] text-[var(--text-secondary)]'>
464464
Are you sure you want to delete the "{selectedTag?.displayName}" tag? This will
@@ -497,7 +497,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
497497
<Modal open={viewDocumentsDialogOpen} onOpenChange={setViewDocumentsDialogOpen}>
498498
<ModalContent size='sm'>
499499
<ModalHeader>Documents using "{selectedTag?.displayName}"</ModalHeader>
500-
<ModalBody className='!pb-[16px]'>
500+
<ModalBody>
501501
<div className='space-y-[8px]'>
502502
<p className='text-[12px] text-[var(--text-tertiary)]'>
503503
{selectedTagUsage?.documentCount || 0} document

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
@@ -336,7 +336,7 @@ export function CreateBaseModal({ open, onOpenChange }: CreateBaseModalProps) {
336336
<ModalHeader>Create Knowledge Base</ModalHeader>
337337

338338
<form onSubmit={handleSubmit(onSubmit)} className='flex min-h-0 flex-1 flex-col'>
339-
<ModalBody className='!pb-[16px]'>
339+
<ModalBody>
340340
<div ref={scrollContainerRef} className='min-h-0 flex-1 overflow-y-auto'>
341341
<div className='space-y-[12px]'>
342342
<div className='flex flex-col gap-[8px]'>
@@ -436,8 +436,8 @@ export function CreateBaseModal({ open, onOpenChange }: CreateBaseModalProps) {
436436
onDragLeave={handleDragLeave}
437437
onDrop={handleDrop}
438438
className={cn(
439-
'!bg-[var(--surface-1)] hover:!bg-[var(--surface-4)] w-full justify-center border border-[var(--c-575757)] border-dashed py-[10px]',
440-
isDragging && 'border-[var(--brand-primary-hex)]'
439+
'!bg-[var(--surface-1)] hover:!bg-[var(--surface-4)] w-full justify-center border border-[var(--border-1)] border-dashed py-[10px]',
440+
isDragging && 'border-[var(--surface-7)]'
441441
)}
442442
>
443443
<input

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function EditKnowledgeBaseModal({
102102
<ModalHeader>Edit Knowledge Base</ModalHeader>
103103

104104
<form onSubmit={handleSubmit(onSubmit)} className='flex min-h-0 flex-1 flex-col'>
105-
<ModalBody className='!pb-[16px]'>
105+
<ModalBody>
106106
<div className='space-y-[12px]'>
107107
<div className='flex flex-col gap-[8px]'>
108108
<Label htmlFor='kb-name'>Name</Label>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/chat/chat.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,26 +510,40 @@ function IdentifierInput({
510510
error && 'border-[var(--text-error)]'
511511
)}
512512
>
513-
<div className='flex items-center whitespace-nowrap bg-[var(--surface-5)] px-[8px] font-medium text-[var(--text-secondary)] text-sm dark:bg-[var(--surface-5)]'>
513+
<div className='flex items-center whitespace-nowrap bg-[var(--surface-5)] pr-[6px] pl-[8px] font-medium text-[var(--text-secondary)] text-sm dark:bg-[var(--surface-5)]'>
514514
{getDomainPrefix()}
515515
</div>
516516
<div className='relative flex-1'>
517517
<Input
518518
id='chat-url'
519-
placeholder='company-name'
519+
placeholder='my-chat'
520520
value={value}
521521
onChange={(e) => handleChange(e.target.value)}
522522
required
523523
disabled={disabled}
524524
className={cn(
525525
'rounded-none border-0 pl-0 shadow-none disabled:bg-transparent disabled:opacity-100',
526-
isChecking && 'pr-[32px]'
526+
(isChecking || (isValid && value)) && 'pr-[32px]'
527527
)}
528528
/>
529-
{isChecking && (
529+
{isChecking ? (
530530
<div className='-translate-y-1/2 absolute top-1/2 right-2'>
531531
<Loader2 className='h-4 w-4 animate-spin text-[var(--text-tertiary)]' />
532532
</div>
533+
) : (
534+
isValid &&
535+
value && (
536+
<Tooltip.Root>
537+
<Tooltip.Trigger asChild>
538+
<div className='-translate-y-1/2 absolute top-1/2 right-2'>
539+
<Check className='h-4 w-4 text-[var(--brand-tertiary-2)]' />
540+
</div>
541+
</Tooltip.Trigger>
542+
<Tooltip.Content>
543+
<span>Name is available</span>
544+
</Tooltip.Content>
545+
</Tooltip.Root>
546+
)
533547
)}
534548
</div>
535549
</div>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/form/form.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useCallback, useEffect, useState } from 'react'
44
import { createLogger } from '@sim/logger'
5-
import { ChevronDown, ChevronRight, Eye, EyeOff, Loader2 } from 'lucide-react'
5+
import { Check, ChevronDown, ChevronRight, Eye, EyeOff, Loader2 } from 'lucide-react'
66
import {
77
Badge,
88
ButtonGroup,
@@ -12,6 +12,7 @@ import {
1212
TagInput,
1313
type TagItem,
1414
Textarea,
15+
Tooltip,
1516
} from '@/components/emcn'
1617
import { Skeleton } from '@/components/ui'
1718
import { getEnv } from '@/lib/core/config/env'
@@ -412,11 +413,7 @@ export function FormDeploy({
412413
const displayUrl = fullUrl.replace(/^https?:\/\//, '')
413414

414415
return (
415-
<form
416-
id='form-deploy-form'
417-
onSubmit={handleSubmit}
418-
className='-mx-1 space-y-4 overflow-y-auto px-1'
419-
>
416+
<form id='form-deploy-form' onSubmit={handleSubmit} className='-mx-1 space-y-4 px-1'>
420417
<div className='space-y-[12px]'>
421418
{/* URL Input - matching chat style */}
422419
<div>
@@ -429,7 +426,7 @@ export function FormDeploy({
429426
(identifierError || errors.identifier) && 'border-[var(--text-error)]'
430427
)}
431428
>
432-
<div className='flex items-center whitespace-nowrap bg-[var(--surface-5)] px-[8px] font-medium text-[var(--text-secondary)] text-sm'>
429+
<div className='flex items-center whitespace-nowrap bg-[var(--surface-5)] pr-[6px] pl-[8px] font-medium text-[var(--text-secondary)] text-sm'>
433430
{getDomainPrefix()}
434431
</div>
435432
<div className='relative flex-1'>
@@ -442,13 +439,28 @@ export function FormDeploy({
442439
placeholder='my-form'
443440
className={cn(
444441
'rounded-none border-0 pl-0 shadow-none',
445-
isCheckingIdentifier && 'pr-[32px]'
442+
(isCheckingIdentifier || (identifierValidationPassed && identifier)) &&
443+
'pr-[32px]'
446444
)}
447445
/>
448-
{isCheckingIdentifier && (
446+
{isCheckingIdentifier ? (
449447
<div className='-translate-y-1/2 absolute top-1/2 right-2'>
450448
<Loader2 className='h-4 w-4 animate-spin text-[var(--text-tertiary)]' />
451449
</div>
450+
) : (
451+
identifierValidationPassed &&
452+
identifier && (
453+
<Tooltip.Root>
454+
<Tooltip.Trigger asChild>
455+
<div className='-translate-y-1/2 absolute top-1/2 right-2'>
456+
<Check className='h-4 w-4 text-[var(--brand-tertiary-2)]' />
457+
</div>
458+
</Tooltip.Trigger>
459+
<Tooltip.Content>
460+
<span>Name is available</span>
461+
</Tooltip.Content>
462+
</Tooltip.Root>
463+
)
452464
)}
453465
</div>
454466
</div>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/mcp/mcp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ export function McpDeploy({
443443
return (
444444
<form
445445
id='mcp-deploy-form'
446-
className='-mx-1 space-y-[12px] overflow-y-auto px-1'
446+
className='-mx-1 space-y-[12px] px-1'
447447
onSubmit={(e) => {
448448
e.preventDefault()
449449
handleSave()

0 commit comments

Comments
 (0)