Skip to content

fix(blocks): preserve agent block color#4671

Merged
waleedlatif1 merged 1 commit into
stagingfrom
codex/agent-block-color
May 20, 2026
Merged

fix(blocks): preserve agent block color#4671
waleedlatif1 merged 1 commit into
stagingfrom
codex/agent-block-color

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented May 20, 2026

Summary

  • keep the default Agent block on its previous purple color
  • decouple the Agent block color from the global brand token
  • keep env, custom-CSS, and org whitelabel primary colors overriding the Agent block color

Testing

  • bun run check:api-validation:strict
  • bun run lint
  • bun run type-check

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 20, 2026 1:04am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 20, 2026

PR Summary

Low Risk
Low risk: changes are limited to UI theming tokens and a minor Tailwind class reorder, with no business logic or data handling impact.

Overview
Introduces a dedicated CSS token --brand-agent (light/dark defaults) and switches the AgentBlock background color to use it, preserving the Agent’s purple color even when --brand is customized.

Updates both env-based (inject-theme.ts) and org-based (org-branding-utils.ts) whitelabel theme generation to also override --brand-agent with the primary color. Also includes a no-op className ordering tweak in the editor header title.

Reviewed by Cursor Bugbot for commit 8844124. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Greptile Summary

This PR decouples the Agent block's background color from the global --brand CSS token by introducing a dedicated --brand-agent variable, preserving the original purple for the default experience while still allowing env-level and org-level whitelabeling to override it.

  • globals.css: Defines --brand-agent as a fixed purple (#6f3dfa light / #701ffc dark), replacing the previous coupling to --brand.
  • agent.ts: Switches bgColor from var(--brand) to var(--brand-agent).
  • inject-theme.ts / org-branding-utils.ts: Both whitelabeling paths now also set --brand-agent to the primary brand color, so the override behavior is fully preserved.
  • editor.tsx: Cosmetic reordering of two Tailwind arbitrary-property classes; no functional change.

Confidence Score: 5/5

Safe to merge — the change is small, targeted, and both whitelabeling override paths are correctly updated.

The decoupling is straightforward: a new CSS variable with a fixed purple default, and both whitelabeling code paths updated to propagate the brand primary color to the new variable. No existing behavior is broken — the agent block still picks up org/env brand overrides, and non-whitelabeled deployments retain the original purple. The unrelated editor.tsx class reorder is purely cosmetic.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/agent.ts Switches bgColor from var(--brand) to var(--brand-agent) — core of the fix
apps/sim/app/_styles/globals.css Adds --brand-agent CSS variable for light (#6f3dfa) and dark (#701ffc) modes, decoupling agent block color from --brand
apps/sim/ee/whitelabeling/inject-theme.ts Propagates NEXT_PUBLIC_BRAND_PRIMARY_COLOR to --brand-agent so env-level whitelabeling still overrides the agent block color
apps/sim/ee/whitelabeling/org-branding-utils.ts Propagates org primaryColor to --brand-agent so org-level whitelabeling still overrides the agent block color
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx Cosmetic class-order reordering of [overflow:clip] and [overflow-clip-margin:3px]; no functional impact

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Agent Block bgColor] -->|reads| B["var(--brand-agent)"]
    B -->|default| C["globals.css\n#6f3dfa light / #701ffc dark"]
    B -->|env override| D["inject-theme.ts\nNEXT_PUBLIC_BRAND_PRIMARY_COLOR"]
    B -->|org override| E["org-branding-utils.ts\nsettings.primaryColor"]
    D -->|sets| B
    E -->|sets| B
Loading

Reviews (1): Last reviewed commit: "fix(blocks): preserve agent block color" | Re-trigger Greptile

Comment thread apps/sim/app/_styles/globals.css
@waleedlatif1 waleedlatif1 force-pushed the codex/agent-block-color branch from 8844124 to 662bcee Compare May 20, 2026 01:04
@waleedlatif1 waleedlatif1 merged commit d55f40c into staging May 20, 2026
9 checks passed
@waleedlatif1 waleedlatif1 deleted the codex/agent-block-color branch May 20, 2026 01:05
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