fix(tags): only show start block upstream if is ancestor (#2013)

This commit is contained in:
Siddharth Ganesan
2025-11-15 12:27:34 -08:00
committed by GitHub
parent c25ea5c677
commit fca92a7499
3 changed files with 7 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ export function useAccessibleReferencePrefixes(blockId?: string | null): Set<str
const starterBlock = Object.values(blocks).find(
(block) => block.type === 'starter' || block.type === 'start_trigger'
)
if (starterBlock) {
if (starterBlock && ancestorIds.includes(starterBlock.id)) {
accessibleIds.add(starterBlock.id)
}

View File

@@ -85,9 +85,10 @@ export class BlockPathCalculator {
const pathNodes = BlockPathCalculator.findAllPathNodes(workflow.connections, block.id)
pathNodes.forEach((nodeId) => accessibleBlocks.add(nodeId))
// Always allow referencing the starter block (special case)
// Only add starter block if it's actually upstream (already in pathNodes)
// Don't add it just because it exists on the canvas
const starterBlock = workflow.blocks.find((b) => b.metadata?.id === 'starter')
if (starterBlock && starterBlock.id !== block.id) {
if (starterBlock && starterBlock.id !== block.id && pathNodes.includes(starterBlock.id)) {
accessibleBlocks.add(starterBlock.id)
}

View File

@@ -592,7 +592,9 @@ export class Serializer {
const accessibleIds = new Set<string>(ancestorIds)
accessibleIds.add(blockId)
if (starterBlock) {
// Only add starter block if it's actually upstream (already in ancestorIds)
// Don't add it just because it exists on the canvas
if (starterBlock && ancestorIds.includes(starterBlock.id)) {
accessibleIds.add(starterBlock.id)
}