Skip to content

Commit 1798c4e

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
improvement(ui): reuse chip controls for remaining workflow pickers
1 parent 5668f0d commit 1798c4e

18 files changed

Lines changed: 94 additions & 49 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
Button,
66
ChipButtonGroup,
77
ChipButtonGroupItem,
8+
ChipSelect,
89
Code,
9-
Combobox,
1010
Label,
1111
Skeleton,
1212
Tooltip,
@@ -560,9 +560,11 @@ console.log(limits);`
560560
<span>{copied.async ? 'Copied' : 'Copy'}</span>
561561
</Tooltip.Content>
562562
</Tooltip.Root>
563-
<Combobox
564-
size='sm'
565-
className='w-fit! min-w-[100px] rounded-md px-[9px] py-0.5!'
563+
<ChipSelect
564+
className='min-w-[100px]'
565+
showSelectedCheck
566+
modal={false}
567+
maxHeight={192}
566568
options={[
567569
{ label: 'Start Execution', value: 'execute' },
568570
{ label: 'Check Status', value: 'status' },

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
2-
import { Combobox, type ComboboxOption, cn } from '@sim/emcn'
2+
import { ChipCombobox, type ComboboxOption, cn } from '@sim/emcn'
33
import { Plus } from '@sim/emcn/icons'
44
import { useReactFlow } from '@xyflow/react'
55
import { useDeploymentShape } from '@/lib/core/config/deployment-shape'
@@ -274,7 +274,6 @@ export const ComboBox = memo(function ComboBox({
274274
isModelUsable,
275275
])
276276

277-
// Convert options to Combobox format
278277
const comboboxOptions = useMemo((): ComboboxOption[] => {
279278
const mapped = evaluatedOptions.map((option): ComboboxOption => {
280279
if (typeof option === 'string') {
@@ -544,13 +543,12 @@ export const ComboBox = memo(function ComboBox({
544543
ctrlOnChangeRef.current = ctrlOnChange
545544
onDropRef.current = onDrop
546545
onDragOverRef.current = onDragOver
547-
// Store the input ref for passing to Combobox
548546
if (ref.current) {
549547
inputRefFromController.current = ref.current as HTMLInputElement
550548
}
551549

552550
return (
553-
<Combobox
551+
<ChipCombobox
554552
options={comboboxOptions}
555553
value={inputValue}
556554
selectedValue={value ?? ''}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/document-tag-entry/document-tag-entry.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { useMemo, useRef } from 'react'
44
import {
55
Badge,
66
Button,
7+
ChipCombobox,
78
CollapsibleCard,
8-
Combobox,
99
type ComboboxOption,
1010
cn,
1111
Input,
@@ -375,7 +375,7 @@ export function DocumentTagEntry({
375375
<>
376376
<div className='flex flex-col gap-1.5'>
377377
<Label className='text-small'>Tag</Label>
378-
<Combobox
378+
<ChipCombobox
379379
options={tagOptions}
380380
value={tag.tagName}
381381
onChange={(value) => updateTag(tag.id, 'tagName', value)}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { fetched } = vi.hoisted(() => ({
2020

2121
vi.mock('@sim/emcn', () => ({
2222
ChipTag: ({ children }: { children?: React.ReactNode }) => <span data-chip>{children}</span>,
23-
Combobox: ({
23+
ChipCombobox: ({
2424
options,
2525
multiSelectValues,
2626
overlayContent,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
2-
import { ChipTag, Combobox, type ComboboxOption } from '@sim/emcn'
2+
import { ChipCombobox, ChipTag, type ComboboxOption } from '@sim/emcn'
33
import { generateId } from '@sim/utils/id'
44
import { isRecordLike } from '@sim/utils/object'
55
import {
@@ -508,7 +508,7 @@ export const Dropdown = memo(function Dropdown({
508508
const isSearchable = searchable || (subBlockId === 'operation' && comboboxOptions.length > 5)
509509

510510
return (
511-
<Combobox
511+
<ChipCombobox
512512
options={comboboxOptions}
513513
value={multiSelect ? undefined : (singleValue ?? undefined)}
514514
multiSelectValues={multiSelect ? (multiValues ?? undefined) : undefined}

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

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

33
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
4-
import { Button, Combobox, cn } from '@sim/emcn'
4+
import { Button, ChipCombobox, cn } from '@sim/emcn'
55
import { X } from '@sim/emcn/icons'
66
import { createLogger } from '@sim/logger'
77
import { getErrorMessage } from '@sim/utils/errors'
@@ -168,7 +168,7 @@ function SingleFileSelector({
168168

169169
return (
170170
<div className='relative w-full'>
171-
<Combobox
171+
<ChipCombobox
172172
options={options}
173173
value={comboboxValue}
174174
selectedValue={selectedValue}
@@ -943,7 +943,7 @@ export function FileUpload({
943943

944944
{/* Add More dropdown for multiple files */}
945945
{hasFiles && multiple && !isUploading && (
946-
<Combobox
946+
<ChipCombobox
947947
options={comboboxOptions}
948948
value={inputValue}
949949
onChange={handleComboboxChange}
@@ -987,7 +987,7 @@ export function FileUpload({
987987

988988
{/* Show dropdown selector if no files and not uploading */}
989989
{!hasFiles && !isUploading && (
990-
<Combobox
990+
<ChipCombobox
991991
options={comboboxOptions}
992992
value={inputValue}
993993
onChange={handleComboboxChange}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/filter-builder/components/filter-rule-row.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { useRef } from 'react'
22
import {
33
Badge,
44
Button,
5+
ChipCombobox,
56
ChipSelect,
67
CollapsibleCard,
7-
Combobox,
88
type ComboboxOption,
99
cn,
1010
Input,
@@ -234,7 +234,7 @@ export function FilterRuleRow({
234234

235235
<div className='flex flex-col gap-1.5'>
236236
<Label className='text-small'>Column</Label>
237-
<Combobox
237+
<ChipCombobox
238238
options={columns}
239239
value={rule.column}
240240
onChange={(v) => onUpdate(rule.id, 'column', v)}

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import { useRef } from 'react'
44
import {
55
Badge,
66
Button,
7+
ChipCombobox,
8+
ChipSelect,
9+
type ChipSelectOption,
710
CollapsibleCard,
8-
Combobox,
911
type ComboboxOption,
1012
cn,
1113
Input,
@@ -371,7 +373,7 @@ export function KnowledgeTagFilters({
371373
}))
372374

373375
const operators = getOperatorsForFieldType(filter.fieldType)
374-
const operatorOptions: ComboboxOption[] = operators.map((op) => ({
376+
const operatorOptions: ChipSelectOption[] = operators.map((op) => ({
375377
value: op.value,
376378
label: op.label,
377379
}))
@@ -382,7 +384,7 @@ export function KnowledgeTagFilters({
382384
<>
383385
<div className='flex flex-col gap-1.5'>
384386
<Label className='text-small'>Tag</Label>
385-
<Combobox
387+
<ChipCombobox
386388
options={tagOptions}
387389
value={filter.tagName}
388390
onChange={(value) => updateFilter(filter.id, 'tagName', value)}
@@ -393,7 +395,13 @@ export function KnowledgeTagFilters({
393395

394396
<div className='flex flex-col gap-1.5'>
395397
<Label className='text-small'>Operator</Label>
396-
<Combobox
398+
<ChipSelect
399+
fullWidth
400+
align='start'
401+
dropdownWidth='trigger'
402+
showSelectedCheck
403+
modal={false}
404+
maxHeight={192}
397405
options={operatorOptions}
398406
value={filter.operator}
399407
onChange={(value) => updateFilter(filter.id, 'operator', value)}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useCallback, useState } from 'react'
2-
import { Combobox, FieldDivider, Label, Slider, Switch } from '@sim/emcn'
2+
import { ChipCombobox, FieldDivider, Label, Slider, Switch } from '@sim/emcn'
33
import { createLogger } from '@sim/logger'
44
import { useParams } from 'next/navigation'
55
import { formatDisplayText } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/formatted-text'
@@ -282,7 +282,7 @@ export function McpDynamicArgs({
282282

283283
return (
284284
<div key={`${paramName}-dropdown`}>
285-
<Combobox
285+
<ChipCombobox
286286
options={dropdownOptions}
287287
value={dropdownValue}
288288
selectedValue={dropdownValue}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/skill-input/skill-input.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, useState } from 'react'
4-
import { Combobox, type ComboboxOptionGroup } from '@sim/emcn'
4+
import { ChipCombobox, type ComboboxOptionGroup } from '@sim/emcn'
55
import { Plus, X } from '@sim/emcn/icons'
66
import { useParams } from 'next/navigation'
77
import { AgentSkillsIcon } from '@/components/icons'
@@ -133,7 +133,7 @@ export function SkillInput({
133133
return (
134134
<>
135135
<div className='w-full space-y-2'>
136-
<Combobox
136+
<ChipCombobox
137137
options={[]}
138138
groups={skillGroups}
139139
placeholder='Add skill...'

0 commit comments

Comments
 (0)