Skip to content

Commit c1d3db2

Browse files
Try using wizard modal
1 parent 3200588 commit c1d3db2

12 files changed

Lines changed: 769 additions & 461 deletions

File tree

apps/sim/app/workspace/[workspaceId]/tables/components/import-csv-dialog/import-csv-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export function ImportCsvDialog({
363363
<div className='flex flex-col gap-4'>
364364
<div className='flex items-center justify-between gap-3 rounded-sm border border-[var(--border)] p-2'>
365365
<div className='flex min-w-0 flex-col'>
366-
<span className='truncate text-caption text-[var(--text-primary)]'>
366+
<span className='truncate text-[var(--text-primary)] text-caption'>
367367
{parsed.file.name}
368368
</span>
369369
<span className='text-[var(--text-tertiary)] text-xs'>

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

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,58 @@
1-
import { Checkbox, Label } from '@/components/emcn'
1+
import { Info } from 'lucide-react'
2+
import { Checkbox, Label, Tooltip } from '@/components/emcn'
23
import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value'
34

5+
interface CheckboxListOption {
6+
label: string
7+
id: string
8+
defaultChecked?: boolean
9+
description?: string
10+
}
11+
412
interface CheckboxListProps {
513
blockId: string
614
subBlockId: string
715
title: string
8-
options: { label: string; id: string }[]
16+
options: CheckboxListOption[]
917
isPreview?: boolean
1018
subBlockValues?: Record<string, any>
1119
disabled?: boolean
1220
}
1321

1422
interface CheckboxItemProps {
1523
blockId: string
16-
option: { label: string; id: string }
24+
option: CheckboxListOption
1725
isPreview: boolean
1826
subBlockValues?: Record<string, any>
1927
disabled: boolean
2028
}
2129

2230
/**
23-
* Individual checkbox item component that calls useSubBlockValue hook at top level
31+
* Individual checkbox item component that calls useSubBlockValue hook at top level.
32+
*
33+
* @remarks
34+
* A `null` store value means the user has never toggled the checkbox, in which
35+
* case we fall back to `option.defaultChecked` for the displayed state. Any
36+
* explicit boolean (including `false`) takes precedence over the default.
2437
*/
2538
function CheckboxItem({ blockId, option, isPreview, subBlockValues, disabled }: CheckboxItemProps) {
26-
const [storeValue, setStoreValue] = useSubBlockValue(blockId, option.id)
39+
const [storeValue, setStoreValue] = useSubBlockValue<boolean>(blockId, option.id)
2740

28-
// Get preview value for this specific option
2941
const previewValue = isPreview && subBlockValues ? subBlockValues[option.id]?.value : undefined
30-
31-
// Use preview value when in preview mode, otherwise use store value
32-
const value = isPreview ? previewValue : storeValue
42+
const rawValue = isPreview ? previewValue : storeValue
43+
const effectiveValue = rawValue ?? option.defaultChecked ?? false
3344

3445
const handleChange = (checked: boolean) => {
35-
// Only update store when not in preview mode or disabled
3646
if (!isPreview && !disabled) {
3747
setStoreValue(checked)
3848
}
3949
}
4050

4151
return (
42-
<div className='flex items-center space-x-2'>
52+
<div className='flex items-center gap-2'>
4353
<Checkbox
4454
id={`${blockId}-${option.id}`}
45-
checked={Boolean(value)}
55+
checked={Boolean(effectiveValue)}
4656
onCheckedChange={handleChange}
4757
disabled={isPreview || disabled}
4858
/>
@@ -52,21 +62,29 @@ function CheckboxItem({ blockId, option, isPreview, subBlockValues, disabled }:
5262
>
5363
{option.label}
5464
</Label>
65+
{option.description && (
66+
<Tooltip.Root>
67+
<Tooltip.Trigger asChild>
68+
<Info className='h-[14px] w-[14px] cursor-default text-[var(--text-muted)]' />
69+
</Tooltip.Trigger>
70+
<Tooltip.Content side='top' align='start' className='max-w-xs'>
71+
<p>{option.description}</p>
72+
</Tooltip.Content>
73+
</Tooltip.Root>
74+
)}
5575
</div>
5676
)
5777
}
5878

5979
export function CheckboxList({
6080
blockId,
61-
subBlockId,
62-
title,
6381
options,
6482
isPreview = false,
6583
subBlockValues,
6684
disabled = false,
6785
}: CheckboxListProps) {
6886
return (
69-
<div className='grid grid-cols-1 gap-4 pt-1'>
87+
<div className='flex flex-col gap-y-2.5 pt-1'>
7088
{options.map((option) => (
7189
<CheckboxItem
7290
key={option.id}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export { ScheduleInfo } from './schedule-info/schedule-info'
2222
export { SelectorInput, type SelectorOverrides } from './selector-input/selector-input'
2323
export { ShortInput } from './short-input/short-input'
2424
export { SkillInput } from './skill-input/skill-input'
25-
export { SlackManifestGenerator } from './slack-manifest-generator/slack-manifest-generator'
25+
export { SlackSetupWizard } from './slack-setup-wizard/slack-setup-wizard'
2626
export { SliderInput } from './slider-input/slider-input'
2727
export { SortBuilder } from './sort-builder/sort-builder'
2828
export { InputFormat } from './starter/input-format'

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slack-manifest-generator/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)