Skip to content

Commit 4c5d31e

Browse files
committed
refactor: drop two more dead prop chains in the sub-block editor
`GroupedCheckboxList` declares `title` (required) and `maxHeight` and reads neither. It renders its own hardcoded copy instead — `Select PII Types to Detect` for the header and `PII types` for the field label — so a block author who sets `title` on a `grouped-checkbox-list` subBlock gets silence, and the `maxHeight = 400` default implies a scroll ceiling that is never applied. Both props go, along with the two values `sub-block.tsx` was passing. `flatTagList` was threaded through the recursive tag renderers to a dead end: declared on `NestedTagRendererProps`, inherited by `FolderContentsProps`, destructured in both, forwarded once more, and read by neither. Its real consumer is `flatTagIndexMap`, built from it at the top level and documented "Map from tag string to index for O(1) lookups" — so the array was being carried alongside its own index through arbitrary nesting depth. The top-level memo and its length checks stay; only the descent goes. Note the component's copy is PII-specific while its name and props present as generic. Renaming it is a separate call, not made here. Both removals were caught mid-flight by `tsc`: my line patterns also matched a live `flatTagList` on `KeyboardNavigationHandler` and a live `title` on `Switch`, which is exactly why the type-check runs before the commit and not after. (cherry picked from commit 5db44f3)
1 parent e14c80e commit 4c5d31e

3 files changed

Lines changed: 1 addition & 12 deletions

File tree

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,19 @@ function SelectedCountDisplay({ noneSelected, allSelected, count }: SelectedCoun
3535
interface GroupedCheckboxListProps {
3636
blockId: string
3737
subBlockId: string
38-
title: string
3938
options: { label: string; id: string; group?: string }[]
4039
isPreview?: boolean
4140
subBlockValues: Record<string, any>
4241
disabled?: boolean
43-
maxHeight?: number
4442
}
4543

4644
export function GroupedCheckboxList({
4745
blockId,
4846
subBlockId,
49-
title,
5047
options,
5148
isPreview = false,
5249
subBlockValues,
5350
disabled = false,
54-
maxHeight = 400,
5551
}: GroupedCheckboxListProps) {
5652
const activeSearchTarget = useActiveSearchTarget()
5753
const [open, setOpen] = useState(false)

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ const buildNestedTagTree = (tags: string[], blockName: string): NestedTag[] => {
376376
interface NestedTagRendererProps {
377377
nestedTag: NestedTag
378378
group: NestedBlockTagGroup
379-
flatTagList: Array<{ tag: string; group?: BlockTagGroup }>
380379
/** Map from tag string to index for O(1) lookups */
381380
flatTagIndexMap: Map<string, number>
382381
selectedIndex: number
@@ -403,7 +402,6 @@ interface FolderContentsProps extends NestedTagRendererProps {
403402
*/
404403
const FolderContentsInner: React.FC<FolderContentsProps> = ({
405404
group,
406-
flatTagList,
407405
flatTagIndexMap,
408406
selectedIndex,
409407
setSelectedIndex,
@@ -565,7 +563,6 @@ const FolderContents: React.FC<Omit<NestedTagRendererProps, never>> = (props) =>
565563
const NestedTagRenderer: React.FC<NestedTagRendererProps> = ({
566564
nestedTag,
567565
group,
568-
flatTagList,
569566
flatTagIndexMap,
570567
selectedIndex,
571568
setSelectedIndex,
@@ -612,7 +609,6 @@ const NestedTagRenderer: React.FC<NestedTagRendererProps> = ({
612609
<FolderContents
613610
nestedTag={nestedTag}
614611
group={group}
615-
flatTagList={flatTagList}
616612
flatTagIndexMap={flatTagIndexMap}
617613
selectedIndex={selectedIndex}
618614
setSelectedIndex={setSelectedIndex}
@@ -1633,9 +1629,9 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
16331629
</PopoverAnchor>
16341630
<KeyboardNavigationHandler
16351631
visible={visible}
1632+
flatTagList={flatTagList}
16361633
selectedIndex={selectedIndex}
16371634
setSelectedIndex={setSelectedIndex}
1638-
flatTagList={flatTagList}
16391635
nestedBlockTagGroups={nestedBlockTagGroups}
16401636
handleTagSelect={handleTagSelect}
16411637
onFolderEnter={() => {
@@ -1720,7 +1716,6 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
17201716
key={`${group.blockId}-${nestedTag.key}`}
17211717
nestedTag={nestedTag}
17221718
group={group}
1723-
flatTagList={flatTagList}
17241719
flatTagIndexMap={flatTagIndexMap}
17251720
selectedIndex={selectedIndex}
17261721
setSelectedIndex={setSelectedIndex}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,12 +844,10 @@ function SubBlockComponent({
844844
<GroupedCheckboxList
845845
blockId={blockId}
846846
subBlockId={config.id}
847-
title={config.title ?? ''}
848847
options={config.options as { label: string; id: string; group?: string }[]}
849848
isPreview={isPreview}
850849
subBlockValues={subBlockValues ?? {}}
851850
disabled={isDisabled}
852-
maxHeight={config.maxHeight}
853851
/>
854852
)
855853

0 commit comments

Comments
 (0)