Skip to content

refactor(ui): Replace raw Tailwind color classes with project design tokens #12033

Open
Cristhianzl wants to merge 3 commits intomainfrom
cz/fix-tailwind-raw-colors
Open

refactor(ui): Replace raw Tailwind color classes with project design tokens #12033
Cristhianzl wants to merge 3 commits intomainfrom
cz/fix-tailwind-raw-colors

Conversation

@Cristhianzl
Copy link
Member

@Cristhianzl Cristhianzl commented Mar 4, 2026

Objective
Improve theme consistency by replacing hardcoded Tailwind color utilities with project-defined design tokens across 33 frontend files.

Changes

  • Replace text-gray-* classes with text-muted-foreground semantic token
  • Replace text-green-* / text-red-* / text-yellow-* with text-accent-emerald-foreground,
    text-accent-red-foreground, text-status-yellow tokens
  • Replace bg-gray-, bg-white, border-gray- with bg-muted, bg-background, border-border tokens
  • Update applies.css utility classes to use design tokens
  • Update related test assertions to match new class names

Summary by CodeRabbit

  • Style
    • Updated UI color scheme across the application, replacing direct color utilities with semantic design tokens for improved visual consistency and enhanced theme flexibility throughout all components.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fe2a1c61-2911-4005-945d-0e40df11dcb4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This pull request systematically updates color utility classes across the frontend codebase to use semantic design tokens from a design system instead of hard-coded Tailwind colors. Changes affect status indicators, buttons, text, borders, and other UI elements while preserving all layout and functionality.

Changes

Cohort / File(s) Summary
List and Selection Components
src/frontend/src/CustomNodes/GenericNode/components/ListSelectionComponent/ListItem.tsx, src/frontend/src/CustomNodes/GenericNode/components/ListSelectionComponent/index.tsx
Updated metadata and empty-state text colors from text-gray-500 to text-muted-foreground, and check icon from text-green-500 to text-accent-emerald-foreground.
Note Node Components
src/frontend/src/CustomNodes/NoteNode/components/color-picker-buttons.tsx, src/frontend/src/CustomNodes/NoteNode/components/select-items.tsx, src/frontend/src/CustomNodes/NoteNode/__tests__/color-picker-buttons.test.tsx
Updated preset color borders from border-blue-500 to border-accent-indigo-foreground, delete option styling from focus:bg-red-400 and text-red-400 to focus:bg-destructive and text-destructive.
Chat Message Components
src/frontend/src/components/core/playgroundComponent/chat-view/chat-messages/components/bot-message.tsx, src/frontend/src/components/core/playgroundComponent/chat-view/chat-messages/components/thinking-message.tsx, src/frontend/src/components/core/playgroundComponent/chat-view/chat-messages/components/__tests__/chat-message.test.tsx, src/frontend/src/components/core/chatComponents/ContentBlockDisplay.tsx, src/frontend/src/components/core/chatComponents/ContentDisplay.tsx
Updated check mark icons from text-emerald-400 to text-accent-emerald-foreground and error text from text-red-500 to text-destructive.
Header and Layout Components
src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx, src/frontend/src/components/core/appHeaderComponent/index.tsx, src/frontend/src/components/core/border-trail.tsx, src/frontend/src/components/common/animatedNumbers/index.tsx
Updated theme indicator colors to accent variants, separator border from dark:border-zinc-700 to dark:border-border, motion div background from bg-zinc-500 to bg-muted-foreground, and animated numbers from zinc colors to text-foreground.
Folder Sidebar Components
src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/components/add-folder-button.tsx, src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/components/upload-folder-button.tsx
Simplified button styling from dark-mode-aware colors to text-muted-foreground with hover:bg-muted.
Modal Components
src/frontend/src/modals/IOModal/components/IOFieldView/components/session-selector.tsx, src/frontend/src/modals/addMcpServerModal/index.tsx, src/frontend/src/modals/apiModal/index.tsx, src/frontend/src/modals/codeAreaModal/index.tsx, src/frontend/src/modals/fileManagerModal/components/dragFilesComponent/index.tsx, src/frontend/src/modals/modelProviderModal/components/ProviderConfigurationForm.tsx, src/frontend/src/modals/saveChangesModal/index.tsx, src/frontend/src/modals/templatesModal/components/TemplateGetStartedCardComponent/index.tsx
Updated error indicators from text-red-500 to text-destructive, confirmation buttons from green to text-accent-emerald-foreground, warning styling from amber-specific classes to bg-warning and text-warning-foreground, category labels from text-zinc-400 to text-muted-foreground, and border colors to semantic tokens.
Flow and Toolbar Components
src/frontend/src/pages/FlowPage/components/SelectionMenuComponent/index.tsx, src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx, src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/toolbarSelectItem/index.tsx
Updated button borders from border-indigo-300 to border-accent-indigo-foreground, freeze button from text-blue-500 to text-accent-indigo-foreground, ping icon from text-green-500 to text-accent-emerald-foreground, and delete option styling to destructive tokens.
Knowledge Base and Status Config
src/frontend/src/pages/MainPage/pages/knowledgePage/config/statusConfig.ts, src/frontend/src/pages/MainPage/pages/knowledgePage/config/__tests__/knowledgeBaseColumns.test.tsx, src/frontend/src/pages/MainPage/pages/homePage/components/McpAutoInstallContent.tsx
Updated status text colors to semantic tokens: ready/ingesting/cancelling to emerald/amber variants, failed to text-destructive, empty to text-muted-foreground, and alert styling from amber-specific to bg-accent-amber and text-accent-amber-foreground.
Other Components and Styles
src/frontend/src/components/core/jsonEditor/index.tsx, src/frontend/src/customization/components/custom-parameter.tsx, src/frontend/src/style/applies.css
Updated button backgrounds from !bg-green-500 to !bg-accent-emerald-foreground, required field indicators from text-red-500 to text-destructive, and CSS classes for border colors, backgrounds, and text to accent and semantic foreground variants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test File Naming And Structure ⚠️ Warning FILE_ICONS mock in knowledgeBaseColumns.test.tsx does not match production definitions in styleUtils.ts: pdf and txt icon values differ. Update FILE_ICONS mock in knowledgeBaseColumns.test.tsx lines 19-28: change pdf.icon from 'FileText' to 'File' and txt.icon from 'FileCode' to 'FileType'.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: replacing raw Tailwind color classes with project design tokens across the UI, which is consistent with all the file changes shown in the raw summary.
Test Coverage For New Implementations ✅ Passed PR is a pure styling refactoring replacing raw Tailwind colors with semantic design tokens across 33 files; three test files appropriately updated their assertions for new CSS class names without functional changes.
Test Quality And Coverage ✅ Passed The test suite demonstrates adequate quality and coverage for this styling refactoring PR with three updated test files following React Testing Library best practices and validating design token migration.
Excessive Mock Usage Warning ✅ Passed Test files demonstrate appropriate mock usage targeting external dependencies and utilities rather than core logic, with mock-to-test ratios proportional to component complexity.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cz/fix-tailwind-raw-colors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the refactor Maintenance tasks and housekeeping label Mar 4, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Mar 4, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 23%
23.23% (8228/35409) 16.02% (4458/27821) 15.92% (1185/7443)

Unit Test Results

Tests Skipped Failures Errors Time
2631 0 💤 0 ❌ 0 🔥 44.18s ⏱️

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx (1)

26-30: ⚠️ Potential issue | 🟡 Minor

Add type annotation for the theme parameter.

The theme parameter lacks TypeScript typing, which reduces type safety.

💡 Proposed fix
-  const handleThemeChange = (theme) => {
+  const handleThemeChange = (theme: "light" | "dark" | "system") => {
     setHasInteracted(true); // Mark that a button has been clicked
     setSelectedTheme(theme);
     setThemePreference(theme);
   };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx`
around lines 26 - 30, handleThemeChange currently accepts an untyped theme
parameter; add a TypeScript type annotation to the parameter (e.g. change the
signature of handleThemeChange to handleThemeChange(theme: ThemePreference) or
handleThemeChange(theme: 'light'|'dark'|'system') depending on your existing
types) so calls to setHasInteracted, setSelectedTheme and setThemePreference are
type-safe; import or reference the existing Theme/ThemePreference type if
available, otherwise declare the explicit union string type in this file.
🧹 Nitpick comments (3)
src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx (1)

52-64: Consider using the cn() utility for conditional class composition.

The coding guidelines recommend using the cn() utility function for combining Tailwind CSS classes. This would improve readability and maintainability of the conditional styling logic. However, since this is a pre-existing pattern and the PR focuses on token replacement, this can be addressed separately.

♻️ Example refactor using cn()
import { cn } from "@/utils/utils";

// Then in the Button:
<Button
  unstyled
  className={cn(
    "relative z-10 inline-flex items-center rounded-full px-1",
    selectedTheme === "light"
      ? "text-foreground"
      : "text-foreground hover:bg-accent-amber-foreground hover:text-background"
  )}
  onClick={() => handleThemeChange("light")}
  data-testid="menu_light_button"
  id="menu_light_button"
>

As per coding guidelines: "Use the cn() utility function for combining Tailwind CSS classes in components".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx`
around lines 52 - 64, Replace the inline conditional className string in the
ThemeButtons component's Button (the element rendering ForwardedIconComponent
with id/data-testid "menu_light_button") to use the cn() utility for class
composition; import cn from "@/utils/utils" (or existing utils file) and pass
the static classes ("relative z-10 inline-flex items-center rounded-full px-1")
and the conditional classes (selectedTheme === "light" ? "text-foreground" :
"text-foreground hover:bg-accent-amber-foreground hover:text-background") as
separate arguments to cn() so the conditional styling is clearer and consistent
with project conventions.
src/frontend/src/components/core/jsonEditor/index.tsx (1)

395-398: Consider using bg-accent-emerald instead of bg-accent-emerald-foreground for background color.

The code (though commented out) uses bg-accent-emerald-foreground for button background. Typically, -foreground tokens are designed for text colors, while the base token (accent-emerald) is intended for backgrounds. Based on the Tailwind config snippet provided, accent-emerald exists as a separate token.

🔧 Suggested semantic correction
             className={cn(
               "min-w-[60px] whitespace-nowrap",
-              showSuccess && "!bg-accent-emerald-foreground hover:!bg-accent-emerald-foreground/90",
+              showSuccess && "!bg-accent-emerald hover:!bg-accent-emerald-hover",
             )}

Note: This code is currently commented out, so this is a low-priority suggestion for when it gets re-enabled.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/src/components/core/jsonEditor/index.tsx` around lines 395 -
398, The className conditional uses the token "bg-accent-emerald-foreground" for
the success background; change it to the background token "bg-accent-emerald"
where showSuccess is applied so the button uses the intended background color
(update the className expression that calls cn with showSuccess, referencing the
same cn utility and the showSuccess boolean in this component).
src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx (1)

771-786: Minor inconsistency in Delete option styling tokens.

The Delete option uses text-status-red for the text/icon container (line 772) but text-destructive for the keyboard shortcut icon (line 783). Consider unifying these to use the same token for consistency, unless text-status-red is intentionally a different semantic color than text-destructive.

🔧 Suggested fix for consistency
-                <SelectItem value={"delete"} className="focus:bg-destructive/[.20]">
-                  <div className="font-red flex text-status-red">
+                <SelectItem value={"delete"} className="focus:bg-destructive/[.20]">
+                  <div className="font-red flex text-destructive">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx`
around lines 771 - 786, The Delete SelectItem uses two different color tokens:
the container div applies text-status-red while the shortcut IconComponent uses
text-destructive; update one so both use the same semantic token for consistency
(e.g., change the div's class or the IconComponent's class so both use
text-destructive or both use text-status-red) in the SelectItem with value
"delete" (look for the IconComponent instances inside that SelectItem) to ensure
uniform styling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/toolbarSelectItem/index.tsx`:
- Line 18: The JSX className currently uses a template literal with `${ping &&
"animate-pulse text-accent-emerald-foreground"}` which can yield the literal
"false" when ping is falsy; update the element in toolbarSelectItem/index.tsx
(the JSX node with className={`mr-2 mt-[0.15em] h-4 w-4 ...`}) to use the
project's cn() utility to compose classes (e.g., cn("mr-2 mt-[0.15em] h-4 w-4",
{ "animate-pulse text-accent-emerald-foreground": ping })), and add the
appropriate import for cn if missing so conditional classes are handled safely.

In
`@src/frontend/src/pages/MainPage/pages/homePage/components/McpAutoInstallContent.tsx`:
- Line 30: The banner in McpAutoInstallContent.tsx uses bg-accent-amber with
text-accent-amber-foreground which currently resolve to the same color; update
the alert's class string to use a clearly contrasting text token (for example
replace text-accent-amber-foreground with text-foreground or a dedicated
contrasting token like text-accent-amber-contrast) so the text is readable
against bg-accent-amber, or alternatively change the background to a
lighter/darker accent variant (e.g., an /emphasis or /muted accent token) to
restore contrast; if you prefer a design-system fix, adjust the
--accent-amber-foreground token value at the theme level to guarantee sufficient
contrast.

In
`@src/frontend/src/pages/MainPage/pages/knowledgePage/config/__tests__/knowledgeBaseColumns.test.tsx`:
- Around line 20-21: The FILE_ICONS mock in the test is out of sync: update the
mocked entries for pdf and txt in the FILE_ICONS mock used by the
knowledgeBaseColumns tests so their icon names match production (use "File" for
pdf and "FileType" for txt) instead of "FileText" and "FileCode", ensuring the
column renderer test exercises the same icon selection logic as the real
src/frontend/src/utils/styleUtils.ts FILE_ICONS mapping.

---

Outside diff comments:
In
`@src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx`:
- Around line 26-30: handleThemeChange currently accepts an untyped theme
parameter; add a TypeScript type annotation to the parameter (e.g. change the
signature of handleThemeChange to handleThemeChange(theme: ThemePreference) or
handleThemeChange(theme: 'light'|'dark'|'system') depending on your existing
types) so calls to setHasInteracted, setSelectedTheme and setThemePreference are
type-safe; import or reference the existing Theme/ThemePreference type if
available, otherwise declare the explicit union string type in this file.

---

Nitpick comments:
In
`@src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx`:
- Around line 52-64: Replace the inline conditional className string in the
ThemeButtons component's Button (the element rendering ForwardedIconComponent
with id/data-testid "menu_light_button") to use the cn() utility for class
composition; import cn from "@/utils/utils" (or existing utils file) and pass
the static classes ("relative z-10 inline-flex items-center rounded-full px-1")
and the conditional classes (selectedTheme === "light" ? "text-foreground" :
"text-foreground hover:bg-accent-amber-foreground hover:text-background") as
separate arguments to cn() so the conditional styling is clearer and consistent
with project conventions.

In `@src/frontend/src/components/core/jsonEditor/index.tsx`:
- Around line 395-398: The className conditional uses the token
"bg-accent-emerald-foreground" for the success background; change it to the
background token "bg-accent-emerald" where showSuccess is applied so the button
uses the intended background color (update the className expression that calls
cn with showSuccess, referencing the same cn utility and the showSuccess boolean
in this component).

In `@src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx`:
- Around line 771-786: The Delete SelectItem uses two different color tokens:
the container div applies text-status-red while the shortcut IconComponent uses
text-destructive; update one so both use the same semantic token for consistency
(e.g., change the div's class or the IconComponent's class so both use
text-destructive or both use text-status-red) in the SelectItem with value
"delete" (look for the IconComponent instances inside that SelectItem) to ensure
uniform styling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 40dda7bb-a4d2-4e6b-a1b0-6c19db81462d

📥 Commits

Reviewing files that changed from the base of the PR and between f37b250 and c8b51dd.

📒 Files selected for processing (33)
  • src/frontend/src/CustomNodes/GenericNode/components/ListSelectionComponent/ListItem.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/ListSelectionComponent/index.tsx
  • src/frontend/src/CustomNodes/NoteNode/__tests__/color-picker-buttons.test.tsx
  • src/frontend/src/CustomNodes/NoteNode/components/color-picker-buttons.tsx
  • src/frontend/src/CustomNodes/NoteNode/components/select-items.tsx
  • src/frontend/src/components/common/animatedNumbers/index.tsx
  • src/frontend/src/components/core/appHeaderComponent/components/ThemeButtons/index.tsx
  • src/frontend/src/components/core/appHeaderComponent/index.tsx
  • src/frontend/src/components/core/border-trail.tsx
  • src/frontend/src/components/core/chatComponents/ContentBlockDisplay.tsx
  • src/frontend/src/components/core/chatComponents/ContentDisplay.tsx
  • src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/components/add-folder-button.tsx
  • src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/components/upload-folder-button.tsx
  • src/frontend/src/components/core/jsonEditor/index.tsx
  • src/frontend/src/components/core/playgroundComponent/chat-view/chat-messages/components/__tests__/chat-message.test.tsx
  • src/frontend/src/components/core/playgroundComponent/chat-view/chat-messages/components/bot-message.tsx
  • src/frontend/src/components/core/playgroundComponent/chat-view/chat-messages/components/thinking-message.tsx
  • src/frontend/src/customization/components/custom-parameter.tsx
  • src/frontend/src/modals/IOModal/components/IOFieldView/components/session-selector.tsx
  • src/frontend/src/modals/addMcpServerModal/index.tsx
  • src/frontend/src/modals/apiModal/index.tsx
  • src/frontend/src/modals/codeAreaModal/index.tsx
  • src/frontend/src/modals/fileManagerModal/components/dragFilesComponent/index.tsx
  • src/frontend/src/modals/modelProviderModal/components/ProviderConfigurationForm.tsx
  • src/frontend/src/modals/saveChangesModal/index.tsx
  • src/frontend/src/modals/templatesModal/components/TemplateGetStartedCardComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/SelectionMenuComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/toolbarSelectItem/index.tsx
  • src/frontend/src/pages/MainPage/pages/homePage/components/McpAutoInstallContent.tsx
  • src/frontend/src/pages/MainPage/pages/knowledgePage/config/__tests__/knowledgeBaseColumns.test.tsx
  • src/frontend/src/pages/MainPage/pages/knowledgePage/config/statusConfig.ts
  • src/frontend/src/style/applies.css

<ForwardedIconComponent
name={icon}
className={`mr-2 mt-[0.15em] h-4 w-4 ${ping && "animate-pulse text-green-500"}`}
className={`mr-2 mt-[0.15em] h-4 w-4 ${ping && "animate-pulse text-accent-emerald-foreground"}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

JavaScript template literal ${false} interpolation behavior and best practice for conditional React className composition with Tailwind CSS

💡 Result:

1) Why `${false}` becomes "false" (and why that matters in className)

In a template literal, each ${…} expression is string-coerced (effectively via ToString/String(...)). So false becomes the string "false" — meaning patterns like:

`btn ${isActive && "btn-active"}`

will produce "btn false" when isActive is false. (developer.mozilla.org)

2) Best practice: don’t use && inside template literals for classes

Prefer a class-joining helper that drops falsy values, like clsx (or classnames):

import { clsx } from "clsx";

<button className={clsx("btn", isActive && "btn-active")} />

clsx explicitly discards falsy values (and even standalone booleans), so you won’t accidentally render "false" as a class token. (npmjs.com)

3) Tailwind-specific best practice: don’t dynamically construct partial class names

Tailwind scans your source as text and can’t understand string interpolation like bg-${color}-600; it recommends mapping to complete, static class strings instead:

const variants = {
  blue: "bg-blue-600 hover:bg-blue-500",
  red: "bg-red-600 hover:bg-red-500",
} as const;

<button className={clsx("rounded px-2 py-1", variants[color])} />

This keeps class names statically detectable. (tailwindcss.com)

4) Common “best of both worlds” setup (Tailwind + React)

Many codebases wrap clsx with tailwind-merge so conflicting utilities resolve predictably:

import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

Then:

<div className={cn("p-2 text-sm", isActive && "text-lg", className)} />

(infinum.com)

Citations:


🏁 Script executed:

# Verify the exact code in the file
cat -n src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/toolbarSelectItem/index.tsx | head -30

Repository: langflow-ai/langflow

Length of output: 1194


Use cn() utility to compose conditional Tailwind classes instead of template literals with && operator.

Line 18 uses ${ping && "animate-pulse text-accent-emerald-foreground"} in a template literal. When ping is falsy, this produces the literal string "false" as a class, which should be avoided. Apply the cn() utility function (per project guidelines) to safely handle conditional classes:

Proposed fix
+import { cn } from "../../../../utils/cn";
+
  export default function ToolbarSelectItem({
    value,
    icon,
    style,
    dataTestId,
    ping,
    shortcut,
  }: toolbarSelectItemProps) {
    const fixedShortcut = shortcut?.split("+");
    return (
      <div className={`flex ${style}`} data-testid={dataTestId}>
        <ForwardedIconComponent
          name={icon}
-         className={`mr-2 mt-[0.15em] h-4 w-4 ${ping && "animate-pulse text-accent-emerald-foreground"}`}
+         className={cn("mr-2 mt-[0.15em] h-4 w-4", ping && "animate-pulse text-accent-emerald-foreground")}
        />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
className={`mr-2 mt-[0.15em] h-4 w-4 ${ping && "animate-pulse text-accent-emerald-foreground"}`}
import { cn } from "../../../../utils/cn";
export default function ToolbarSelectItem({
value,
icon,
style,
dataTestId,
ping,
shortcut,
}: toolbarSelectItemProps) {
const fixedShortcut = shortcut?.split("+");
return (
<div className={`flex ${style}`} data-testid={dataTestId}>
<ForwardedIconComponent
name={icon}
className={cn("mr-2 mt-[0.15em] h-4 w-4", ping && "animate-pulse text-accent-emerald-foreground")}
/>
</div>
);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/toolbarSelectItem/index.tsx`
at line 18, The JSX className currently uses a template literal with `${ping &&
"animate-pulse text-accent-emerald-foreground"}` which can yield the literal
"false" when ping is falsy; update the element in toolbarSelectItem/index.tsx
(the JSX node with className={`mr-2 mt-[0.15em] h-4 w-4 ...`}) to use the
project's cn() utility to compose classes (e.g., cn("mr-2 mt-[0.15em] h-4 w-4",
{ "animate-pulse text-accent-emerald-foreground": ping })), and add the
appropriate import for cn if missing so conditional classes are handled safely.

<div className="flex flex-col gap-1 mt-4">
{!isLocalConnection && (
<div className="mb-2 rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-950 dark:text-amber-200">
<div className="mb-2 rounded-md bg-accent-amber px-3 py-2 text-sm text-accent-amber-foreground">
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Potential contrast regression in the alert banner (text and background may be identical).

At Line 30, bg-accent-amber is paired with text-accent-amber-foreground, but current token values indicate both amber vars resolve to the same HSL in light theme. This can make the warning text unreadable.

Suggested fix
-      <div className="mb-2 rounded-md bg-accent-amber px-3 py-2 text-sm text-accent-amber-foreground">
+      <div className="mb-2 rounded-md bg-accent-amber/15 px-3 py-2 text-sm text-accent-amber-foreground">

If the filled amber background is desired, the better fix is at token level (set --accent-amber-foreground to a contrasting value).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="mb-2 rounded-md bg-accent-amber px-3 py-2 text-sm text-accent-amber-foreground">
<div className="mb-2 rounded-md bg-accent-amber/15 px-3 py-2 text-sm text-accent-amber-foreground">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/frontend/src/pages/MainPage/pages/homePage/components/McpAutoInstallContent.tsx`
at line 30, The banner in McpAutoInstallContent.tsx uses bg-accent-amber with
text-accent-amber-foreground which currently resolve to the same color; update
the alert's class string to use a clearly contrasting text token (for example
replace text-accent-amber-foreground with text-foreground or a dedicated
contrasting token like text-accent-amber-contrast) so the text is readable
against bg-accent-amber, or alternatively change the background to a
lighter/darker accent variant (e.g., an /emphasis or /muted accent token) to
restore contrast; if you prefer a design-system fix, adjust the
--accent-amber-foreground token value at the theme level to guarantee sufficient
contrast.

Comment on lines +20 to +21
pdf: { icon: "FileText", color: "text-datatype-red dark:text-datatype-red-foreground" },
txt: { icon: "FileCode", color: "text-datatype-purple dark:text-datatype-purple-foreground" },
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix FILE_ICONS mock drift for pdf and txt icons

On Line 20 and Line 21, the mocked icon names (FileText, FileCode) don’t match the production FILE_ICONS mapping in src/frontend/src/utils/styleUtils.ts (File, FileType). This can mask icon-selection regressions in the column renderer tests.

Suggested patch
 jest.mock("@/utils/styleUtils", () => ({
   FILE_ICONS: {
-    pdf: { icon: "FileText", color: "text-datatype-red dark:text-datatype-red-foreground" },
-    txt: { icon: "FileCode", color: "text-datatype-purple dark:text-datatype-purple-foreground" },
+    pdf: { icon: "File", color: "text-datatype-red dark:text-datatype-red-foreground" },
+    txt: { icon: "FileType", color: "text-datatype-purple dark:text-datatype-purple-foreground" },
   },
 }));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pdf: { icon: "FileText", color: "text-datatype-red dark:text-datatype-red-foreground" },
txt: { icon: "FileCode", color: "text-datatype-purple dark:text-datatype-purple-foreground" },
pdf: { icon: "File", color: "text-datatype-red dark:text-datatype-red-foreground" },
txt: { icon: "FileType", color: "text-datatype-purple dark:text-datatype-purple-foreground" },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/frontend/src/pages/MainPage/pages/knowledgePage/config/__tests__/knowledgeBaseColumns.test.tsx`
around lines 20 - 21, The FILE_ICONS mock in the test is out of sync: update the
mocked entries for pdf and txt in the FILE_ICONS mock used by the
knowledgeBaseColumns tests so their icon names match production (use "File" for
pdf and "FileType" for txt) instead of "FileText" and "FileCode", ensuring the
column renderer test exercises the same icon selection logic as the real
src/frontend/src/utils/styleUtils.ts FILE_ICONS mapping.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.46%. Comparing base (f37b250) to head (7977625).

Files with missing lines Patch % Lines
...ode/components/ListSelectionComponent/ListItem.tsx 0.00% 1 Missing ⚠️
...Nodes/NoteNode/components/color-picker-buttons.tsx 50.00% 0 Missing and 1 partial ⚠️
.../src/customization/components/custom-parameter.tsx 0.00% 1 Missing ⚠️
...FlowPage/components/nodeToolbarComponent/index.tsx 0.00% 1 Missing ⚠️
...s/nodeToolbarComponent/toolbarSelectItem/index.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12033   +/-   ##
=======================================
  Coverage   37.45%   37.46%           
=======================================
  Files        1616     1616           
  Lines       79041    79041           
  Branches    11945    11945           
=======================================
+ Hits        29606    29611    +5     
+ Misses      47777    47772    -5     
  Partials     1658     1658           
Flag Coverage Δ
backend 57.43% <ø> (+0.02%) ⬆️
frontend 20.82% <16.66%> (ø)
lfx 42.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...icNode/components/ListSelectionComponent/index.tsx 0.00% <ø> (ø)
...c/CustomNodes/NoteNode/components/select-items.tsx 0.00% <ø> (ø)
...nd/src/components/common/animatedNumbers/index.tsx 0.00% <ø> (ø)
...pHeaderComponent/components/ThemeButtons/index.tsx 0.00% <ø> (ø)
...d/src/components/core/appHeaderComponent/index.tsx 0.00% <ø> (ø)
src/frontend/src/components/core/border-trail.tsx 0.00% <ø> (ø)
...onents/core/chatComponents/ContentBlockDisplay.tsx 0.00% <ø> (ø)
.../components/core/chatComponents/ContentDisplay.tsx 0.00% <ø> (ø)
...eBarFolderButtons/components/add-folder-button.tsx 0.00% <ø> (ø)
...rFolderButtons/components/upload-folder-button.tsx 0.00% <ø> (ø)
... and 19 more

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Maintenance tasks and housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant