Skip to content

Commit 785b86a

Browse files
authored
fix(tag-dropdown): fix values for parallel & loop blocks (#929)
1 parent e5e8082 commit 785b86a

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

apps/sim/components/ui/tag-dropdown.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,6 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
539539
const containingLoopBlock = blocks[loopId]
540540
if (containingLoopBlock) {
541541
const loopBlockName = containingLoopBlock.name || containingLoopBlock.type
542-
const normalizedLoopBlockName = normalizeBlockName(loopBlockName)
543-
contextualTags.push(`${normalizedLoopBlockName}.results`)
544542

545543
loopBlockGroup = {
546544
blockName: loopBlockName,
@@ -565,8 +563,6 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
565563
const containingParallelBlock = blocks[parallelId]
566564
if (containingParallelBlock) {
567565
const parallelBlockName = containingParallelBlock.name || containingParallelBlock.type
568-
const normalizedParallelBlockName = normalizeBlockName(parallelBlockName)
569-
contextualTags.push(`${normalizedParallelBlockName}.results`)
570566

571567
parallelBlockGroup = {
572568
blockName: parallelBlockName,
@@ -803,11 +799,23 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
803799
})
804800
} else {
805801
const path = tagParts.slice(1).join('.')
806-
directTags.push({
807-
key: path || group.blockName,
808-
display: path || group.blockName,
809-
fullTag: tag,
810-
})
802+
// Handle contextual tags for loop/parallel blocks (single words like 'index', 'currentItem')
803+
if (
804+
(group.blockType === 'loop' || group.blockType === 'parallel') &&
805+
tagParts.length === 1
806+
) {
807+
directTags.push({
808+
key: tag,
809+
display: tag,
810+
fullTag: tag,
811+
})
812+
} else {
813+
directTags.push({
814+
key: path || group.blockName,
815+
display: path || group.blockName,
816+
fullTag: tag,
817+
})
818+
}
811819
}
812820
})
813821

0 commit comments

Comments
 (0)