Skip to content

Commit baef8d7

Browse files
fix(styling): fix styling inconsistencies in dark mode, fix invites fetching to show active members (#1229)
* fix(styling): fix unreadble text in dark mode * fix styling inconsistencies in kb * refetch permissions on invite modal open --------- Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
1 parent b74ab46 commit baef8d7

File tree

14 files changed

+160
-117
lines changed

14 files changed

+160
-117
lines changed

apps/sim/app/chat/[subdomain]/chat.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@
161161
color: hsl(var(--foreground));
162162
}
163163

164+
/* Tooltip overrides - keep tooltips black with white text for consistency */
165+
.chat-light-wrapper [data-radix-tooltip-content] {
166+
background-color: hsl(0 0% 3.9%) !important;
167+
color: hsl(0 0% 98%) !important;
168+
}
169+
164170
/* Force color scheme */
165171
.chat-light-wrapper {
166172
color-scheme: light !important;

apps/sim/app/chat/components/input/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const ChatInput: React.FC<{
118118
<VoiceInput onVoiceStart={handleVoiceStart} disabled={isStreaming} large={true} />
119119
</div>
120120
</TooltipTrigger>
121-
<TooltipContent side='top' className='border border-gray-200 bg-white text-gray-900'>
121+
<TooltipContent side='top'>
122122
<p>Start voice conversation</p>
123123
</TooltipContent>
124124
</Tooltip>

apps/sim/app/chat/components/message/message.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { memo, useMemo, useState } from 'react'
44
import { Check, Copy } from 'lucide-react'
5-
import { Button } from '@/components/ui/button'
65
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
76
import MarkdownRenderer from './components/markdown-renderer'
87

@@ -80,10 +79,8 @@ export const ClientChatMessage = memo(
8079
<TooltipProvider>
8180
<Tooltip delayDuration={300}>
8281
<TooltipTrigger asChild>
83-
<Button
84-
variant='ghost'
85-
size='sm'
86-
className='flex items-center gap-1.5 px-2 py-1'
82+
<button
83+
className='text-muted-foreground transition-colors hover:bg-muted'
8784
onClick={() => {
8885
const contentToCopy =
8986
typeof cleanTextContent === 'string'
@@ -95,15 +92,11 @@ export const ClientChatMessage = memo(
9592
}}
9693
>
9794
{isCopied ? (
98-
<>
99-
<Check className='h-3.5 w-3.5 text-green-500' />
100-
</>
95+
<Check className='h-3 w-3' strokeWidth={2} />
10196
) : (
102-
<>
103-
<Copy className='h-3.5 w-3.5 text-muted-foreground' />
104-
</>
97+
<Copy className='h-3 w-3' strokeWidth={2} />
10598
)}
106-
</Button>
99+
</button>
107100
</TooltipTrigger>
108101
<TooltipContent side='top' align='center' sideOffset={5}>
109102
{isCopied ? 'Copied!' : 'Copy to clipboard'}

apps/sim/app/workspace/[workspaceId]/providers/workspace-permissions-provider.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ interface WorkspacePermissionsContextType {
1919
permissionsLoading: boolean
2020
permissionsError: string | null
2121
updatePermissions: (newPermissions: WorkspacePermissions) => void
22+
refetchPermissions: () => Promise<void>
2223

2324
// Computed user permissions (connection-aware)
2425
userPermissions: WorkspaceUserPermissions & { isOfflineMode?: boolean }
@@ -32,6 +33,7 @@ const WorkspacePermissionsContext = createContext<WorkspacePermissionsContextTyp
3233
permissionsLoading: false,
3334
permissionsError: null,
3435
updatePermissions: () => {},
36+
refetchPermissions: async () => {},
3537
userPermissions: {
3638
canRead: false,
3739
canEdit: false,
@@ -74,6 +76,7 @@ export function WorkspacePermissionsProvider({ children }: WorkspacePermissionsP
7476
loading: permissionsLoading,
7577
error: permissionsError,
7678
updatePermissions,
79+
refetch: refetchPermissions,
7780
} = useWorkspacePermissions(workspaceId)
7881

7982
// Get base user permissions from workspace permissions
@@ -113,10 +116,18 @@ export function WorkspacePermissionsProvider({ children }: WorkspacePermissionsP
113116
permissionsLoading,
114117
permissionsError,
115118
updatePermissions,
119+
refetchPermissions,
116120
userPermissions,
117121
setOfflineMode: setIsOfflineMode,
118122
}),
119-
[workspacePermissions, permissionsLoading, permissionsError, updatePermissions, userPermissions]
123+
[
124+
workspacePermissions,
125+
permissionsLoading,
126+
permissionsError,
127+
updatePermissions,
128+
refetchPermissions,
129+
userPermissions,
130+
]
120131
)
121132

122133
return (

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/chat-deploy/components/success-view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function SuccessView({ deployedUrl, existingChat, onDelete, onUpdate }: S
5353
href={deployedUrl}
5454
target='_blank'
5555
rel='noopener noreferrer'
56-
className='flex h-10 flex-1 items-center break-all rounded-l-md border border-r-0 p-2 font-medium text-primary text-sm'
56+
className='flex h-10 flex-1 items-center break-all rounded-l-md border border-r-0 p-2 font-medium text-foreground text-sm'
5757
>
5858
{subdomainPart}
5959
</a>
@@ -67,7 +67,7 @@ export function SuccessView({ deployedUrl, existingChat, onDelete, onUpdate }: S
6767
href={deployedUrl}
6868
target='_blank'
6969
rel='noopener noreferrer'
70-
className='text-primary hover:underline'
70+
className='text-foreground hover:underline'
7171
>
7272
this URL
7373
</a>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/wand-prompt-bar/wand-prompt-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function WandPromptBar({
132132
variant='ghost'
133133
size='icon'
134134
onClick={() => onSubmit(promptValue)}
135-
className='h-8 w-8 rounded-full text-primary hover:bg-primary/10 hover:text-primary'
135+
className='h-8 w-8 rounded-full text-muted-foreground hover:bg-primary/10 hover:text-foreground'
136136
disabled={isLoading || isStreaming || !promptValue.trim()}
137137
>
138138
<SendIcon className='h-4 w-4' />

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/tool-input/components/code-editor/code-editor.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { highlight, languages } from 'prismjs'
44
import 'prismjs/components/prism-javascript'
55
import 'prismjs/components/prism-json'
66
import 'prismjs/themes/prism.css'
7-
7+
import { Wand2 } from 'lucide-react'
88
import Editor from 'react-simple-code-editor'
99
import { cn } from '@/lib/utils'
1010

@@ -19,6 +19,9 @@ interface CodeEditorProps {
1919
onKeyDown?: (e: React.KeyboardEvent) => void
2020
disabled?: boolean
2121
schemaParameters?: Array<{ name: string; type: string; description: string; required: boolean }>
22+
showWandButton?: boolean
23+
onWandClick?: () => void
24+
wandButtonDisabled?: boolean
2225
}
2326

2427
export function CodeEditor({
@@ -32,6 +35,9 @@ export function CodeEditor({
3235
onKeyDown,
3336
disabled = false,
3437
schemaParameters = [],
38+
showWandButton = false,
39+
onWandClick,
40+
wandButtonDisabled = false,
3541
}: CodeEditorProps) {
3642
const [code, setCode] = useState(value)
3743
const [visualLineHeights, setVisualLineHeights] = useState<number[]>([])
@@ -206,7 +212,23 @@ export function CodeEditor({
206212
className
207213
)}
208214
>
209-
{code.split('\n').length > 5 && (
215+
{showWandButton && onWandClick && (
216+
<button
217+
onClick={onWandClick}
218+
disabled={wandButtonDisabled}
219+
className={cn(
220+
'absolute top-2 right-2 z-10 flex h-8 w-8 items-center justify-center rounded-full border border-transparent bg-muted/80 p-0 text-foreground shadow-sm transition-all duration-200',
221+
'hover:border-primary/20 hover:bg-muted hover:text-foreground hover:shadow',
222+
'opacity-0 transition-opacity group-hover:opacity-100',
223+
wandButtonDisabled && 'cursor-not-allowed opacity-50'
224+
)}
225+
aria-label='Generate with AI'
226+
>
227+
<Wand2 className='h-4 w-4' />
228+
</button>
229+
)}
230+
231+
{!showWandButton && code.split('\n').length > 5 && (
210232
<button
211233
onClick={() => setIsCollapsed(!isCollapsed)}
212234
className={cn(

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useMemo, useRef, useState } from 'react'
2-
import { Code, FileJson, Trash2, Wand2, X } from 'lucide-react'
2+
import { Code, FileJson, Trash2, X } from 'lucide-react'
33
import { useParams } from 'next/navigation'
44
import {
55
AlertDialog,
@@ -934,25 +934,6 @@ try {
934934
<Label htmlFor='json-schema' className='font-medium'>
935935
JSON Schema
936936
</Label>
937-
<Button
938-
variant='ghost'
939-
size='icon'
940-
className='h-5 w-5 rounded-full border border-transparent bg-muted/80 p-0 text-muted-foreground shadow-sm transition-all duration-200 hover:border-primary/20 hover:bg-muted hover:text-primary hover:shadow'
941-
onClick={() => {
942-
logger.debug('Schema AI button clicked')
943-
logger.debug(
944-
'showPromptInline function exists:',
945-
typeof schemaGeneration.showPromptInline === 'function'
946-
)
947-
schemaGeneration.isPromptVisible
948-
? schemaGeneration.hidePromptInline()
949-
: schemaGeneration.showPromptInline()
950-
}}
951-
disabled={schemaGeneration.isLoading || schemaGeneration.isStreaming}
952-
aria-label='Generate schema with AI'
953-
>
954-
<Wand2 className='h-3 w-3' />
955-
</Button>
956937
</div>
957938
{schemaError &&
958939
!schemaGeneration.isStreaming && ( // Hide schema error while streaming
@@ -963,6 +944,18 @@ try {
963944
value={jsonSchema}
964945
onChange={handleJsonSchemaChange}
965946
language='json'
947+
showWandButton={true}
948+
onWandClick={() => {
949+
logger.debug('Schema AI button clicked')
950+
logger.debug(
951+
'showPromptInline function exists:',
952+
typeof schemaGeneration.showPromptInline === 'function'
953+
)
954+
schemaGeneration.isPromptVisible
955+
? schemaGeneration.hidePromptInline()
956+
: schemaGeneration.showPromptInline()
957+
}}
958+
wandButtonDisabled={schemaGeneration.isLoading || schemaGeneration.isStreaming}
966959
placeholder={`{
967960
"type": "function",
968961
"function": {
@@ -1004,25 +997,6 @@ try {
1004997
<Label htmlFor='function-code' className='font-medium'>
1005998
Code (optional)
1006999
</Label>
1007-
<Button
1008-
variant='ghost'
1009-
size='icon'
1010-
className='h-5 w-5 rounded-full border border-transparent bg-muted/80 p-0 text-muted-foreground shadow-sm transition-all duration-200 hover:border-primary/20 hover:bg-muted hover:text-primary hover:shadow'
1011-
onClick={() => {
1012-
logger.debug('Code AI button clicked')
1013-
logger.debug(
1014-
'showPromptInline function exists:',
1015-
typeof codeGeneration.showPromptInline === 'function'
1016-
)
1017-
codeGeneration.isPromptVisible
1018-
? codeGeneration.hidePromptInline()
1019-
: codeGeneration.showPromptInline()
1020-
}}
1021-
disabled={codeGeneration.isLoading || codeGeneration.isStreaming}
1022-
aria-label='Generate code with AI'
1023-
>
1024-
<Wand2 className='h-3 w-3' />
1025-
</Button>
10261000
</div>
10271001
{codeError &&
10281002
!codeGeneration.isStreaming && ( // Hide code error while streaming
@@ -1050,6 +1024,18 @@ try {
10501024
value={functionCode}
10511025
onChange={handleFunctionCodeChange}
10521026
language='javascript'
1027+
showWandButton={true}
1028+
onWandClick={() => {
1029+
logger.debug('Code AI button clicked')
1030+
logger.debug(
1031+
'showPromptInline function exists:',
1032+
typeof codeGeneration.showPromptInline === 'function'
1033+
)
1034+
codeGeneration.isPromptVisible
1035+
? codeGeneration.hidePromptInline()
1036+
: codeGeneration.showPromptInline()
1037+
}}
1038+
wandButtonDisabled={codeGeneration.isLoading || codeGeneration.isStreaming}
10531039
placeholder={
10541040
'// This code will be executed when the tool is called. You can use environment variables with {{VARIABLE_NAME}}.'
10551041
}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ export function ToolInput({
14151415
</Toggle>
14161416
</TooltipTrigger>
14171417
<TooltipContent className='max-w-[280px] p-2' side='top'>
1418-
<p className='text-muted-foreground text-xs'>
1418+
<p className='text-xs'>
14191419
Control how the model uses this tool in its response.
14201420
{tool.usageControl === 'auto' && (
14211421
<span>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { cn } from '@/lib/utils'
2+
import { getDocumentIcon } from '@/app/workspace/[workspaceId]/knowledge/components/icons/document-icons'
3+
4+
interface Document {
5+
id: string
6+
name: string
7+
tagValue: string
8+
}
9+
10+
interface DocumentListProps {
11+
documents: Document[]
12+
totalCount: number
13+
maxHeight?: 'max-h-32' | 'max-h-80'
14+
showMoreText?: boolean
15+
}
16+
17+
export function DocumentList({
18+
documents,
19+
totalCount,
20+
maxHeight = 'max-h-32',
21+
showMoreText = true,
22+
}: DocumentListProps) {
23+
const displayLimit = 5
24+
const hasMore = totalCount > displayLimit
25+
26+
return (
27+
<div className='rounded-md border border-border bg-background'>
28+
<div className={cn(maxHeight, 'overflow-y-auto')}>
29+
{documents.slice(0, displayLimit).map((doc) => {
30+
const DocumentIcon = getDocumentIcon('', doc.name)
31+
return (
32+
<div
33+
key={doc.id}
34+
className='flex items-center gap-3 border-border/50 border-b p-3 transition-colors last:border-b-0 hover:bg-muted/30'
35+
>
36+
<DocumentIcon className='h-4 w-4 flex-shrink-0' />
37+
<div className='min-w-0 flex-1 overflow-hidden'>
38+
<div className='truncate font-medium text-sm' style={{ maxWidth: '300px' }}>
39+
{doc.name}
40+
</div>
41+
{doc.tagValue && (
42+
<div className='mt-1 text-muted-foreground text-xs'>
43+
Tag value: <span className='font-medium'>{doc.tagValue}</span>
44+
</div>
45+
)}
46+
</div>
47+
</div>
48+
)
49+
})}
50+
{hasMore && showMoreText && (
51+
<div className='flex items-center gap-3 p-3 text-muted-foreground text-sm'>
52+
<div className='h-4 w-4' />
53+
<div className='font-medium'>and {totalCount - displayLimit} more documents...</div>
54+
</div>
55+
)}
56+
</div>
57+
</div>
58+
)
59+
}

0 commit comments

Comments
 (0)