Skip to content

Conversation

@Shivam-002
Copy link
Contributor

Updated the Switch background to use var(--brand-500) rather than var (--surface-13) when checked. This provides a clear visual cue to the user that the component is active.

Summary

Brief description of what this PR does and why.

Fixes #(issue)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

How has this been tested? What should reviewers focus on?

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)

Screenshots/Videos

switch-active-state-change

Updated the Switch background to use var(--brand-500) rather than var (--surface-13) when checked. This provides a clear visual cue to the user that the component is active.
@vercel
Copy link

vercel bot commented Dec 16, 2025

@Shivam-002 is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 16, 2025

Greptile Overview

Greptile Summary

Updated Switch components to use var(--brand-500) for improved visibility in the checked state. The EMCN switch now uses the brand color universally, while the UI switch applies it only in dark mode.

  • EMCN switch: Changed from --surface-14 to --brand-500 for checked state
  • UI switch: Changed from --surface-13 to --brand-500 for dark mode checked state only

Inconsistency found: The two switch components have different behavior - EMCN uses brand color in all modes, while UI switch still uses --surface-11 in light mode. Consider applying brand color consistently across both light and dark modes for the UI switch to match the EMCN implementation.

Confidence Score: 4/5

  • This PR is safe to merge with minor styling inconsistency
  • The changes are minimal CSS variable updates that improve visibility. However, the inconsistent behavior between the two switch components (one uses brand color universally, the other only in dark mode) should be addressed for better UX consistency.
  • Pay attention to apps/sim/components/ui/switch.tsx for the light mode styling inconsistency

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/components/emcn/components/switch/switch.tsx 5/5 Updated checked state to use --brand-500 for better visibility. Change is clean and consistent.
apps/sim/components/ui/switch.tsx 4/5 Updated dark mode checked state to use --brand-500. Light mode still uses --surface-11, creating inconsistency with EMCN switch.

Sequence Diagram

sequenceDiagram
    participant User
    participant Switch
    participant CSS Variables
    
    User->>Switch: Clicks switch component
    Switch->>Switch: Toggle state to checked
    alt EMCN Switch
        Switch->>CSS Variables: Apply bg-[var(--brand-500)]
    else UI Switch (Light Mode)
        Switch->>CSS Variables: Apply bg-[var(--surface-11)]
    else UI Switch (Dark Mode)
        Switch->>CSS Variables: Apply bg-[var(--brand-500)]
    end
    CSS Variables->>Switch: Render background color
    Switch->>User: Display active state
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. apps/sim/components/ui/switch.tsx, line 13 (link)

    style: Light mode checked state still uses var(--surface-11) while dark mode uses var(--brand-500). This creates inconsistency with the EMCN switch component which uses --brand-500 for all modes. Consider using --brand-500 for light mode as well.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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