Skip to content

Commit a66f4f2

Browse files
fix(interfaces): pin deployed chat + resume to light mode, emcn-only components
1 parent 42e3a03 commit a66f4f2

12 files changed

Lines changed: 383 additions & 611 deletions

File tree

apps/sim/app/(interfaces)/chat/[identifier]/chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export default function ChatClient({ identifier }: { identifier: string }) {
426426
}
427427

428428
return (
429-
<div className='dark fixed inset-0 z-[100] flex flex-col bg-[var(--landing-bg)] text-[var(--landing-text)]'>
429+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
430430
{/* Header component */}
431431
<ChatHeader chatConfig={chatConfig} starCount={starCount} />
432432

apps/sim/app/(interfaces)/chat/[identifier]/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Skeleton } from '@sim/emcn'
22

33
export default function ChatLoading() {
44
return (
5-
<div className='dark fixed inset-0 z-[100] flex flex-col bg-[var(--landing-bg)] text-[var(--landing-text)]'>
5+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
66
<div className='border-[var(--border-1)] border-b px-4 py-3'>
77
<div className='mx-auto flex max-w-3xl items-center justify-between'>
88
<div className='flex items-center gap-[12px]'>

apps/sim/app/(interfaces)/chat/components/error-state/error-state.tsx

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

3+
import { Button } from '@sim/emcn'
34
import { useRouter } from 'next/navigation'
45

56
interface ChatErrorStateProps {
@@ -16,12 +17,13 @@ export function ChatErrorState({ error }: ChatErrorStateProps) {
1617
Chat Unavailable
1718
</h1>
1819
<p className='text-[var(--text-muted)] text-lg'>{error}</p>
19-
<button
20+
<Button
21+
variant='primary'
2022
onClick={() => router.push('/workspace')}
21-
className='inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-[var(--text-primary)] bg-[var(--text-primary)] px-2.5 text-[var(--bg)] text-sm transition-colors hover:border-[var(--text-body)] hover:bg-[var(--text-body)] disabled:cursor-not-allowed disabled:opacity-50'
23+
className='h-[32px] w-full gap-2 px-2.5 text-sm'
2224
>
2325
Return to Workspace
24-
</button>
26+
</Button>
2527
</div>
2628
</div>
2729
)

apps/sim/app/(interfaces)/chat/components/header/header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
4040
className='size-6 rounded-md object-cover'
4141
/>
4242
)}
43-
<h2 className='font-medium text-[var(--landing-text)] text-lg'>
43+
<h2 className='font-medium text-[var(--text-primary)] text-lg'>
4444
{chatConfig?.customizations?.headerText || chatConfig?.title || 'Chat'}
4545
</h2>
4646
</div>
@@ -52,7 +52,7 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
5252
href='https://github.com/simstudioai/sim'
5353
target='_blank'
5454
rel='noopener noreferrer'
55-
className='flex items-center gap-2 text-[var(--landing-text-muted)] text-md transition-colors hover:text-[var(--landing-text)]'
55+
className='flex items-center gap-2 text-[var(--text-muted)] text-md transition-colors hover:text-[var(--text-primary)]'
5656
aria-label={`GitHub repository - ${starCount} stars`}
5757
>
5858
<GithubIcon className='size-[16px]' aria-hidden='true' />
@@ -67,7 +67,7 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
6767
aria-label='Sim home'
6868
>
6969
<Image
70-
src='/logo/sim-landing.svg'
70+
src='/logo/wordmark-dark.svg'
7171
alt='Sim'
7272
width={71}
7373
height={22}

apps/sim/app/(interfaces)/chat/components/input/input.tsx

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

33
import type React from 'react'
44
import { useCallback, useLayoutEffect, useRef, useState } from 'react'
5-
import { Badge, cn, handleKeyboardActivation, Tooltip } from '@sim/emcn'
5+
import { Badge, Button, cn, handleKeyboardActivation, Tooltip } from '@sim/emcn'
66
import { createLogger } from '@sim/logger'
77
import { generateId } from '@sim/utils/id'
88
import { ArrowUp, Mic, Paperclip, X } from 'lucide-react'
@@ -168,7 +168,7 @@ export const ChatInput: React.FC<{
168168

169169
return (
170170
<Tooltip.Provider>
171-
<div className='fixed right-0 bottom-0 left-0 flex w-full items-center justify-center bg-gradient-to-t from-[var(--landing-bg)] to-transparent px-4 pb-4 md:px-0 md:pb-4'>
171+
<div className='fixed right-0 bottom-0 left-0 flex w-full items-center justify-center bg-gradient-to-t from-[var(--bg)] to-transparent px-4 pb-4 md:px-0 md:pb-4'>
172172
<div className='w-full max-w-3xl md:max-w-[748px]'>
173173
{/* Error Messages */}
174174
{uploadErrors.length > 0 && (
@@ -191,7 +191,7 @@ export const ChatInput: React.FC<{
191191
handleKeyboardActivation(event, focusTextarea)
192192
}}
193193
className={cn(
194-
'relative z-10 cursor-text rounded-2xl border border-[var(--border-1)] bg-[var(--landing-bg-elevated)] px-2.5 py-2',
194+
'relative z-10 cursor-text rounded-2xl border border-[var(--border-1)] bg-[var(--surface-2)] px-2.5 py-2',
195195
isDragOver && 'border-purple-500'
196196
)}
197197
onDragEnter={(e) => {
@@ -222,31 +222,31 @@ export const ChatInput: React.FC<{
222222
{attachedFiles.map((file) => (
223223
<Tooltip.Root key={file.id}>
224224
<Tooltip.Trigger asChild>
225-
<div className='group relative size-[56px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--landing-bg)]'>
225+
<div className='group relative size-[56px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--surface-3)]'>
226226
{file.dataUrl ? (
227227
<img
228228
src={file.dataUrl}
229229
alt={file.name}
230230
className='h-full w-full object-cover'
231231
/>
232232
) : (
233-
<div className='flex h-full w-full flex-col items-center justify-center gap-0.5 text-[var(--landing-text-muted)]'>
233+
<div className='flex h-full w-full flex-col items-center justify-center gap-0.5 text-[var(--text-muted)]'>
234234
<Paperclip className='size-[18px]' />
235235
<span className='max-w-[48px] truncate px-[2px] text-[9px]'>
236236
{file.name.split('.').pop()}
237237
</span>
238238
</div>
239239
)}
240-
<button
241-
type='button'
240+
<Button
241+
variant='primary'
242242
onClick={(e) => {
243243
e.stopPropagation()
244244
handleRemoveFile(file.id)
245245
}}
246-
className='absolute top-[2px] right-[2px] flex size-[16px] items-center justify-center rounded-full bg-black/60 opacity-0 group-hover:opacity-100'
246+
className='absolute top-[2px] right-[2px] size-[16px] rounded-full p-0 opacity-0 group-hover:opacity-100'
247247
>
248-
<X className='size-[10px] text-white' />
249-
</button>
248+
<X className='size-[10px]' />
249+
</Button>
250250
</div>
251251
</Tooltip.Trigger>
252252
<Tooltip.Content side='top'>
@@ -265,7 +265,7 @@ export const ChatInput: React.FC<{
265265
onKeyDown={handleKeyDown}
266266
placeholder={isDragOver ? 'Drop files here...' : 'Enter a message...'}
267267
rows={1}
268-
className='m-0 h-auto min-h-[24px] w-full resize-none overflow-y-auto overflow-x-hidden border-0 bg-transparent p-1 text-[15px] text-[var(--landing-text)] leading-[24px] caret-[var(--landing-text)] outline-none [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-[var(--landing-text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden'
268+
className='m-0 h-auto min-h-[24px] w-full resize-none overflow-y-auto overflow-x-hidden border-0 bg-transparent p-1 text-[15px] text-[var(--text-primary)] leading-[24px] caret-[var(--text-primary)] outline-none [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-[var(--text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden'
269269
/>
270270

271271
{/* Bottom row */}
@@ -274,14 +274,14 @@ export const ChatInput: React.FC<{
274274
<div>
275275
<Tooltip.Root>
276276
<Tooltip.Trigger asChild>
277-
<button
278-
type='button'
277+
<Button
278+
variant='quiet'
279279
onClick={() => fileInputRef.current?.click()}
280280
disabled={isStreaming || attachedFiles.length >= 15}
281-
className='flex size-[28px] items-center justify-center rounded-full text-[var(--landing-text-muted)] transition-colors hover:bg-[#F7F7F7] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-[#303030]'
281+
className='size-[28px] rounded-full p-0'
282282
>
283283
<Paperclip className='size-[16px]' strokeWidth={2} />
284-
</button>
284+
</Button>
285285
</Tooltip.Trigger>
286286
<Tooltip.Content side='top'>
287287
<p>Attach files</p>
@@ -307,14 +307,14 @@ export const ChatInput: React.FC<{
307307
{sttAvailable && (
308308
<Tooltip.Root>
309309
<Tooltip.Trigger asChild>
310-
<button
311-
type='button'
310+
<Button
311+
variant='quiet'
312312
onClick={onVoiceStart}
313313
disabled={isStreaming}
314-
className='flex size-[28px] items-center justify-center rounded-full text-[var(--landing-text-muted)] transition-colors hover:bg-[#F7F7F7] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-[#303030]'
314+
className='size-[28px] rounded-full p-0'
315315
>
316316
<Mic className='size-[16px]' strokeWidth={2} />
317-
</button>
317+
</Button>
318318
</Tooltip.Trigger>
319319
<Tooltip.Content side='top'>
320320
<p>Start voice conversation</p>
@@ -323,37 +323,29 @@ export const ChatInput: React.FC<{
323323
)}
324324

325325
{isStreaming ? (
326-
<button
327-
type='button'
326+
<Button
327+
variant='primary'
328328
onClick={onStopStreaming}
329-
className='flex size-[28px] items-center justify-center rounded-full border-0 bg-[#383838] p-0 transition-colors hover:bg-[#575757] dark:bg-[#E0E0E0] dark:hover:bg-[#CFCFCF]'
329+
className='size-[28px] rounded-full p-0'
330330
title='Stop generation'
331331
>
332332
<svg
333-
className='block size-[14px] fill-white dark:fill-black'
333+
className='block size-[14px] fill-current'
334334
viewBox='0 0 24 24'
335335
xmlns='http://www.w3.org/2000/svg'
336336
>
337337
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
338338
</svg>
339-
</button>
339+
</Button>
340340
) : (
341-
<button
342-
type='button'
341+
<Button
342+
variant='primary'
343343
onClick={handleSubmit}
344344
disabled={!canSubmit}
345-
className={cn(
346-
'flex h-[28px] w-[28px] items-center justify-center rounded-full border-0 p-0 transition-colors',
347-
canSubmit
348-
? 'bg-[#383838] hover:bg-[#575757] dark:bg-[#E0E0E0] dark:hover:bg-[#CFCFCF]'
349-
: 'bg-[#808080] dark:bg-[#808080]'
350-
)}
345+
className='size-[28px] rounded-full p-0'
351346
>
352-
<ArrowUp
353-
className='block size-[16px] text-white dark:text-black'
354-
strokeWidth={2.25}
355-
/>
356-
</button>
347+
<ArrowUp className='block size-[16px]' strokeWidth={2.25} />
348+
</Button>
357349
)}
358350
</div>
359351
</div>

apps/sim/app/(interfaces)/chat/components/loading-state/loading-state.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Skeleton } from '@sim/emcn'
22

33
export function ChatLoadingState() {
44
return (
5-
<div className='dark fixed inset-0 z-[100] flex flex-col bg-[var(--landing-bg)]'>
5+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)]'>
66
<div className='flex flex-1 items-center justify-center px-4'>
77
<div className='w-full max-w-[410px]'>
88
<div className='flex flex-col items-center justify-center'>

apps/sim/app/(interfaces)/chat/components/message-container/message-container.tsx

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

33
import { memo, type RefObject } from 'react'
4+
import { Button } from '@sim/emcn'
45
import { ArrowDown } from 'lucide-react'
5-
import { Button } from '@/components/ui/button'
66
import {
77
type ChatMessage,
88
ClientChatMessage,
@@ -42,10 +42,10 @@ export const ChatMessageContainer = memo(function ChatMessageContainer({
4242
{messages.length === 0 ? (
4343
<div className='flex flex-col items-center justify-center py-10'>
4444
<div className='space-y-2 text-center'>
45-
<h3 className='font-medium text-[var(--landing-text)] text-lg'>
45+
<h3 className='font-medium text-[var(--text-primary)] text-lg'>
4646
How can I help you today?
4747
</h3>
48-
<p className='text-[var(--landing-text-muted)] text-sm'>
48+
<p className='text-[var(--text-muted)] text-sm'>
4949
{chatConfig?.description || 'Ask me anything.'}
5050
</p>
5151
</div>
@@ -61,7 +61,7 @@ export const ChatMessageContainer = memo(function ChatMessageContainer({
6161
<div className='flex'>
6262
<div className='max-w-[80%]'>
6363
<div className='flex h-6 items-center'>
64-
<div className='loading-dot size-3 rounded-full bg-[var(--landing-text)]' />
64+
<div className='loading-dot size-3 rounded-full bg-[var(--text-primary)]' />
6565
</div>
6666
</div>
6767
</div>
@@ -80,8 +80,7 @@ export const ChatMessageContainer = memo(function ChatMessageContainer({
8080
<Button
8181
onClick={scrollToBottom}
8282
size='sm'
83-
variant='outline'
84-
className='flex items-center gap-1 rounded-full border border-[var(--border-1)] bg-[var(--landing-bg-elevated)] px-3 py-1 shadow-lg transition-all hover:opacity-80'
83+
className='gap-1 rounded-full px-3 py-1 shadow-lg'
8584
>
8685
<ArrowDown className='size-3.5' />
8786
<span className='sr-only'>Scroll to bottom</span>

apps/sim/app/(interfaces)/chat/components/message/components/file-download.tsx

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

33
import { useState } from 'react'
4-
import { Button, Download, Loader } from '@sim/emcn'
4+
import { Button, cn, Download, Loader } from '@sim/emcn'
55
import { createLogger } from '@sim/logger'
66
import { sleep } from '@sim/utils/helpers'
77
import { Music } from 'lucide-react'
@@ -114,14 +114,14 @@ export function ChatFileDownload({ file }: ChatFileDownloadProps) {
114114

115115
const renderIcon = () => {
116116
if (isAudioFile(file.type, file.name)) {
117-
return <Music className='h-4 w-4 text-purple-500' />
117+
return <Music className='size-4 text-purple-500' />
118118
}
119119
if (isImageFile(file.type)) {
120120
const ImageIcon = DefaultFileIcon
121-
return <ImageIcon className='h-5 w-5' />
121+
return <ImageIcon className='size-5' />
122122
}
123123
const DocumentIcon = getDocumentIcon(file.type, file.name)
124-
return <DocumentIcon className='h-5 w-5' />
124+
return <DocumentIcon className='size-5' />
125125
}
126126

127127
return (
@@ -133,19 +133,17 @@ export function ChatFileDownload({ file }: ChatFileDownloadProps) {
133133
disabled={isDownloading}
134134
className='flex h-auto w-[200px] items-center gap-2 rounded-lg px-3 py-2'
135135
>
136-
<div className='flex h-8 w-8 flex-shrink-0 items-center justify-center'>{renderIcon()}</div>
136+
<div className='flex size-8 flex-shrink-0 items-center justify-center'>{renderIcon()}</div>
137137
<div className='min-w-0 flex-1 text-left'>
138138
<div className='w-[100px] truncate text-xs'>{file.name}</div>
139-
<div className='text-[var(--landing-text-muted)] text-micro'>
140-
{formatFileSize(file.size)}
141-
</div>
139+
<div className='text-[var(--text-muted)] text-micro'>{formatFileSize(file.size)}</div>
142140
</div>
143141
<div className='flex-shrink-0'>
144142
{isDownloading ? (
145-
<Loader className='h-3.5 w-3.5' animate />
143+
<Loader className='size-3.5' animate />
146144
) : (
147145
<Download
148-
className={`h-3.5 w-3.5 transition-opacity ${isHovered ? 'opacity-100' : 'opacity-0'}`}
146+
className={cn('size-3.5 transition-opacity', isHovered ? 'opacity-100' : 'opacity-0')}
149147
/>
150148
)}
151149
</div>
@@ -186,16 +184,17 @@ export function ChatFileDownloadAll({ files }: ChatFileDownloadAllProps) {
186184
}
187185

188186
return (
189-
<button
187+
<Button
188+
variant='ghost-secondary'
190189
onClick={handleDownloadAll}
191190
disabled={isDownloading}
192-
className='text-[var(--landing-text-muted)] transition-colors hover:bg-[var(--landing-bg-elevated)] disabled:opacity-50'
191+
className='p-0'
193192
>
194193
{isDownloading ? (
195-
<Loader className='h-3 w-3' animate />
194+
<Loader className='size-3' animate />
196195
) : (
197-
<Download className='h-3 w-3' strokeWidth={2} />
196+
<Download className='size-3' strokeWidth={2} />
198197
)}
199-
</button>
198+
</Button>
200199
)
201200
}

0 commit comments

Comments
 (0)