Skip to content

Commit fc92750

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
improvement(ui): reuse chip comboboxes for workflow resources
1 parent febf5d9 commit fc92750

8 files changed

Lines changed: 24 additions & 16 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx‎

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

33
import { useCallback, useEffect, useMemo, useState } from 'react'
4-
import { Chip, Combobox, type ComboboxOptionGroup } from '@sim/emcn'
4+
import { Chip, ChipCombobox, type ComboboxOptionGroup } from '@sim/emcn'
55
import { Key, SquareArrowUpRight } from '@sim/emcn/icons'
66
import { useParams } from 'next/navigation'
77
import { consumeOAuthReturnContext, writeOAuthReturnContext } from '@/lib/credentials/client-state'
@@ -445,7 +445,7 @@ export function CredentialSelector({
445445

446446
return (
447447
<div>
448-
<Combobox
448+
<ChipCombobox
449449
options={comboboxOptions}
450450
groups={comboboxGroups}
451451
value={displayValue}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/knowledge-base-selector/knowledge-base-selector.tsx‎

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

33
import { useCallback, useMemo } from 'react'
4-
import { ChipTag, Combobox, type ComboboxOption } from '@sim/emcn'
4+
import { ChipCombobox, ChipTag, type ComboboxOption } from '@sim/emcn'
55
import { X } from '@sim/emcn/icons'
66
import { useQueries } from '@tanstack/react-query'
77
import { useParams } from 'next/navigation'
@@ -211,7 +211,7 @@ export function KnowledgeBaseSelector({
211211
</div>
212212
)}
213213

214-
<Combobox
214+
<ChipCombobox
215215
options={options}
216216
value={isMultiSelect ? undefined : (selectedIds[0] ?? '')}
217217
multiSelect={isMultiSelect}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/mcp-server-modal/mcp-server-selector.tsx‎

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

3-
import { Combobox } from '@sim/emcn'
3+
import { ChipCombobox } from '@sim/emcn'
44
import { useParams } from 'next/navigation'
55
import { McpIcon } from '@/components/icons'
66
import { getMcpTargetOptions } from '@/components/mcp/target-options'
@@ -65,7 +65,7 @@ export function McpServerSelector({
6565
})
6666

6767
return (
68-
<Combobox
68+
<ChipCombobox
6969
options={comboboxOptions}
7070
value={inputValue}
7171
selectedValue={selectedServerId}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/mcp-server-modal/mcp-tool-selector.tsx‎

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

33
import { useMemo } from 'react'
4-
import { Combobox } from '@sim/emcn'
4+
import { ChipCombobox } from '@sim/emcn'
55
import { useParams } from 'next/navigation'
66
import { formatDisplayText } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/formatted-text'
77
import { getWorkflowSearchLabelHighlight } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workflow-search-highlight'
@@ -86,7 +86,7 @@ export function McpToolSelector({
8686
})
8787

8888
return (
89-
<Combobox
89+
<ChipCombobox
9090
options={comboboxOptions}
9191
value={inputValue}
9292
selectedValue={selectedToolId}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/model-fallback-list/model-fallback-list.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ vi.mock('@sim/emcn', () => ({
4646
{children}
4747
</button>
4848
),
49-
Combobox: ({
49+
ChipCombobox: ({
5050
options,
5151
value,
5252
placeholder,

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/model-fallback-list/model-fallback-list.tsx‎

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

33
import { memo, useCallback, useEffect, useMemo, useRef } from 'react'
4-
import { Button, Chip, ChipSelect, Combobox, type ComboboxOption, Label, Tooltip } from '@sim/emcn'
4+
import {
5+
Button,
6+
Chip,
7+
ChipCombobox,
8+
ChipSelect,
9+
type ComboboxOption,
10+
Label,
11+
Tooltip,
12+
} from '@sim/emcn'
513
import { ChevronDown, ChevronUp, Plus, Trash } from '@sim/emcn/icons'
614
import { generateShortId } from '@sim/utils/id'
715
import { useParams } from 'next/navigation'
@@ -180,7 +188,7 @@ const FallbackRow = memo(function FallbackRow({
180188
</div>
181189

182190
<div className='flex flex-col gap-2.5 rounded-b-[4px] border-[var(--border)] border-t bg-[var(--surface-2)] p-2'>
183-
<Combobox
191+
<ChipCombobox
184192
options={modelOptions}
185193
value={row.model}
186194
onChange={(model) => onChangeModel(row.id, model)}
@@ -195,7 +203,7 @@ const FallbackRow = memo(function FallbackRow({
195203
{needsApiKey && (
196204
<div className='flex flex-col gap-2.5'>
197205
<Label className='pl-0.5'>API key</Label>
198-
<Combobox
206+
<ChipCombobox
199207
options={envVarOptions}
200208
value={apiKeyValue}
201209
onChange={(apiKey) => onChangeApiKey(row.id, apiKey)}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table-selector/table-selector.tsx‎

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

33
import { useCallback, useMemo } from 'react'
4-
import { Combobox, type ComboboxOption } from '@sim/emcn'
4+
import { ChipCombobox, type ComboboxOption } from '@sim/emcn'
55
import { useParams } from 'next/navigation'
66
import { formatDisplayText } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/formatted-text'
77
import { getWorkflowSearchLabelHighlight } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workflow-search-highlight'
@@ -93,7 +93,7 @@ export function TableSelector({
9393
})
9494

9595
return (
96-
<Combobox
96+
<ChipCombobox
9797
options={options}
9898
value={tableId ?? undefined}
9999
onChange={handleChange}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workspace-folder-selector/workspace-folder-selector.tsx‎

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

33
import { useMemo } from 'react'
4-
import { Combobox } from '@sim/emcn'
4+
import { ChipCombobox } from '@sim/emcn'
55
import { useParams } from 'next/navigation'
66
import type { FolderResourceType } from '@/lib/api/contracts/folders'
77
import { parseFolderPath } from '@/lib/folders/paths'
@@ -58,7 +58,7 @@ export function WorkspaceFolderSelector({
5858
}, [folders, isPlaceholderData, required, subBlock.multiSelect, subBlock.placeholder])
5959

6060
return (
61-
<Combobox
61+
<ChipCombobox
6262
options={options}
6363
value={subBlock.multiSelect ? undefined : selected}
6464
onChange={(value) => {

0 commit comments

Comments
 (0)