Skip to content

fix(editor): stop highlighting start.input as blue when block is not connected to starter#4054

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-router-context-removal
Apr 8, 2026
Merged

fix(editor): stop highlighting start.input as blue when block is not connected to starter#4054
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-router-context-removal

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Removed start from hardcoded system prefixes that always highlight as blue
  • <start.input> now only highlights blue when the block is actually connected to the starter block via edges
  • loop, parallel, and variable remain as system prefixes since they are contextual constructs handled differently

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 8, 2026 7:47pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 8, 2026

PR Summary

Low Risk
Low risk UI-only behavior change that narrows when start.* references are syntax-highlighted; minimal surface area but could affect users who relied on unconditional highlighting.

Overview
Fixes reference highlighting so <start.*> is no longer treated as a hardcoded “system” prefix.

This removes start from the system prefix sets used by formatDisplayText and SYSTEM_REFERENCE_PREFIXES, meaning start references now only highlight when allowed by the contextual accessiblePrefixes (while loop, parallel, and variable remain always-highlighted).

Reviewed by Cursor Bugbot for commit 4940abc. Configure here.

@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Apr 8, 2026

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/fix-router-context-removal branch from 5302603 to 4940abc Compare April 8, 2026 19:47
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 8, 2026

Greptile Summary

This PR fixes a UI highlighting bug where <start.input> references were always rendered in blue regardless of whether the block was actually connected to the starter block. It removes 'start' from the hardcoded system prefix sets in both formatted-text.tsx and references.ts, so the highlighting now relies on the edge-based accessiblePrefixes check — consistent with how all other non-system block references are resolved. The fix is correct because the starter block's name normalises to 'start' (via getUniqueBlockName), so it naturally appears in accessiblePrefixes when it is a true ancestor.

Confidence Score: 5/5

Safe to merge — a minimal, well-scoped change that correctly moves start from a hardcoded system prefix to the edge-driven accessibility check.

Both changed lines are simple set literal updates; all downstream consumers already fall through to accessiblePrefixes when the system-prefix check fails, and the starter block's name normalises to 'start' ensuring continuity when connected. The only finding is a P2 style suggestion about a duplicated constant.

No files require special attention.

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/formatted-text.tsx Removes start from the local SYSTEM_PREFIXES set so <start.input> only highlights when the starter block is an actual ancestor; logically correct but maintains a duplicated constant instead of importing from the canonical source.
apps/sim/lib/workflows/sanitization/references.ts Removes start from SYSTEM_REFERENCE_PREFIXES; all consumers that check this set fall through to accessiblePrefixes.has(normalizedPrefix), which will include start when the starter block (name "Start") is a real ancestor, so the fix is consistent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Reference token detected"] --> B{highlightAll?}
    B -- Yes --> H[Highlight blue]
    B -- No --> C{"prefix in SYSTEM_PREFIXES?\nloop / parallel / variable"}
    C -- Yes --> H
    C -- No --> D{prefix in accessiblePrefixes?}
    D -- Yes --> H
    D -- No --> E[No highlight / plain text]

    F["useAccessibleReferencePrefixes()"] --> G{Starter block\nan ancestor via edges?}
    G -- Yes --> I["normalizeName = 'start'\nadded to accessiblePrefixes"]
    G -- No --> J["'start' absent from accessiblePrefixes"]
    I --> D
    J --> D
Loading

Reviews (1): Last reviewed commit: "fix(editor): stop highlighting start.inp..." | Re-trigger Greptile

}

const SYSTEM_PREFIXES = new Set(['start', 'loop', 'parallel', 'variable'])
const SYSTEM_PREFIXES = new Set(['loop', 'parallel', 'variable'])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicated constant diverges from canonical source

SYSTEM_PREFIXES here is a local copy of SYSTEM_REFERENCE_PREFIXES from references.ts — this PR keeps them in sync, but they can drift again with future changes. Since splitReferenceSegment is already imported from that module, importing SYSTEM_REFERENCE_PREFIXES directly removes the duplication.

Suggested change
const SYSTEM_PREFIXES = new Set(['loop', 'parallel', 'variable'])
import { splitReferenceSegment, SYSTEM_REFERENCE_PREFIXES as SYSTEM_PREFIXES } from '@/lib/workflows/sanitization/references'

Then delete the local const SYSTEM_PREFIXES = new Set(...) declaration entirely.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 4940abc. Configure here.

@waleedlatif1 waleedlatif1 merged commit 4700590 into staging Apr 8, 2026
7 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/fix-router-context-removal branch April 8, 2026 19:51
TheodoreSpeaks pushed a commit that referenced this pull request Apr 8, 2026
TheodoreSpeaks added a commit that referenced this pull request Apr 8, 2026
* fix(billing): skip billing on streamed workflows with byok

* Simplify logic

* Address comments, skip tokenization billing fallback

* Fix tool usage billing for streamed outputs

* fix(webhook): throw webhook errors as 4xxs (#4050)

* fix(webhook): throw webhook errors as 4xxs

* Fix shadowing body var

---------

Co-authored-by: Theodore Li <theo@sim.ai>

* feat(enterprise): cloud whitelabeling for enterprise orgs (#4047)

* feat(enterprise): cloud whitelabeling for enterprise orgs

* fix(enterprise): scope enterprise plan check to target org in whitelabel PUT

* fix(enterprise): use isOrganizationOnEnterprisePlan for org-scoped enterprise check

* fix(enterprise): allow clearing whitelabel fields and guard against empty update result

* fix(enterprise): remove webp from logo accept attribute to match upload hook validation

* improvement(billing): use isBillingEnabled instead of isProd for plan gate bypasses

* fix(enterprise): show whitelabeling nav item when billing is enabled on non-hosted environments

* fix(enterprise): accept relative paths for logoUrl since upload API returns /api/files/serve/ paths

* fix(whitelabeling): prevent logo flash on refresh by hiding logo while branding loads

* fix(whitelabeling): wire hover color through CSS token on tertiary buttons

* fix(whitelabeling): show sim logo by default, only replace when org logo loads

* fix(whitelabeling): cache org logo url in localstorage to eliminate flash on repeat visits

* feat(whitelabeling): add wordmark support with drag/drop upload

* updated turbo

* fix(whitelabeling): defer localstorage read to effect to prevent hydration mismatch

* fix(whitelabeling): use layout effect for cache read to eliminate logo flash before paint

* fix(whitelabeling): cache theme css to eliminate color flash before org settings resolve

* fix(whitelabeling): deduplicate HEX_COLOR_REGEX into lib/branding and remove mutation from useCallback deps

* fix(whitelabeling): use cookie-based SSR cache to eliminate brand flash on all page loads

* fix(whitelabeling): use !orgSettings condition to fix SSR brand cache injection

React Query returns isLoading: false with data: undefined during SSR, so the
previous brandingLoading condition was always false on the server — initialCache
was never injected into brandConfig. Changing to !orgSettings correctly applies
the cookie cache both during SSR and while the client-side query loads, eliminating
the logo flash on hard refresh.

* fix(editor): stop highlighting start.input as blue when block is not connected to starter (#4054)

* fix: merge subblock values in auto-layout to prevent losing router context (#4055)

Auto-layout was reading from getWorkflowState() without merging subblock
store values, then persisting stale subblock data to the database. This
caused runtime-edited values (e.g. router_v2 context) to be overwritten
with their initial/empty values whenever auto-layout was triggered.

* fix(whitelabeling): eliminate logo flash by fetching org settings server-side (#4057)

* fix(whitelabeling): eliminate logo flash by fetching org settings server-side

* improvement(whitelabeling): add SVG support for logo and wordmark uploads

* skelly in workspace header

* remove dead code

* fix(whitelabeling): hydration error, SVG support, skeleton shimmer, dead code removal

* fix(whitelabeling): blob preview dep cycle and missing color fallback

* fix(whitelabeling): use brand-accent as color fallback when workspace color is undefined

* chore(whitelabeling): inline hasOrgBrand

---------

Co-authored-by: Theodore Li <theo@sim.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant