Skip to content

refactor(agentflow): use design tokens for validation colors#5934

Merged
jocelynlin-wd merged 2 commits intomainfrom
refactor/validation-design-tokens
Mar 9, 2026
Merged

refactor(agentflow): use design tokens for validation colors#5934
jocelynlin-wd merged 2 commits intomainfrom
refactor/validation-design-tokens

Conversation

@jocelynlin-wd
Copy link
Contributor

Summary

  • Added tokens.colors.border.validation to the design token system
  • Replaced hardcoded #FFB938 with the new token in AgentFlowNode and ValidationFeedback components

Addresses review feedback from #5915 (#5915 (review)).

Test plan

  • All 455 existing tests pass
  • Verify validation border color renders correctly in light/dark mode

🤖 Generated with Claude Code

Replace hardcoded '#FFB938' validation color with tokens.colors.border.validation
across AgentFlowNode and ValidationFeedback components for consistency
with the design token system.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the application's UI to utilize a design token for validation colors. By moving from a hardcoded color value to a centralized design token, the change enhances the consistency and maintainability of the user interface, particularly for validation feedback elements across different components. This update directly addresses previous review feedback, promoting a more robust and scalable design system.

Highlights

  • Design Tokens: Added tokens.colors.border.validation to the design token system, centralizing the definition of validation-related border colors.
  • Refactoring: Replaced the hardcoded hexadecimal color value #FFB938 with the newly introduced tokens.colors.border.validation in the AgentFlowNode and ValidationFeedback components for improved consistency and maintainability.
Changelog
  • packages/agentflow/src/core/theme/tokens.ts
    • Added a new validation property to the border object within the tokens.colors structure, assigning baseColors.nodeCondition as its value.
  • packages/agentflow/src/features/canvas/components/ValidationFeedback.tsx
    • Imported the tokens object from the theme system.
    • Introduced a validationColor constant, initialized with tokens.colors.border.validation.
    • Replaced hardcoded #FFB938 with validationColor for border, background, and icon colors within the component's styling.
    • Adjusted background color logic to use darken and lighten functions with validationColor for dark and light modes respectively.
  • packages/agentflow/src/features/canvas/containers/AgentFlowNode.tsx
    • Imported the tokens object from the theme system.
    • Updated the borderColor property of the CardWrapper to use tokens.colors.border.validation when hasValidationErrors is true, replacing the hardcoded #FFB938 value.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully refactors hardcoded validation colors to use a new design token, tokens.colors.border.validation. The changes in AgentFlowNode and ValidationFeedback correctly replace the magic string #FFB938 with the new token, improving maintainability and consistency. I have one suggestion in ValidationFeedback.tsx to move a constant declaration out of the component body for a minor performance improvement and better code clarity. Overall, this is a good refactoring.

Hoist the validationColor constant outside the component body
since it's a static value that doesn't need to be redeclared
on every render.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@mmattu-wd mmattu-wd left a comment

Choose a reason for hiding this comment

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

lgtm!

image

default: { light: baseColors.gray300, dark: baseColors.darkGray500 },
hover: { light: baseColors.gray400, dark: baseColors.darkGray600 }
hover: { light: baseColors.gray400, dark: baseColors.darkGray600 },
validation: baseColors.nodeCondition

Choose a reason for hiding this comment

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

👍

@jocelynlin-wd jocelynlin-wd merged commit 605f9ee into main Mar 9, 2026
7 checks passed
@jocelynlin-wd jocelynlin-wd deleted the refactor/validation-design-tokens branch March 9, 2026 18:16
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.

2 participants