Skip to content

Conversation

@fzzv
Copy link
Contributor

@fzzv fzzv commented Jun 1, 2025

Component Dark Theme Support

This PR adds dark mode support for several UI components. The following components have been updated to ensure proper theming, contrast, and visual consistency in dark environments.

Updated Components (Before vs After)

component Before After
Textarea image image
Tab image image
Toggle/ToggleGroup (Solid Hover) image image
Select image image

Summary by CodeRabbit

  • Style

    • Updated border and background colors across Select, Tab, Textarea, and Toggle components to use theme-based colors instead of hardcoded values, improving consistency with the app’s design system.
    • Enhanced placeholder styling in the Textarea component for better readability.
    • Refined color scheme for Toggle component’s solid variant to align with theme colors.
  • Refactor

    • Replaced third-party tab and textarea implementations in preview components with custom UI components, maintaining existing functionality and structure.

@vercel
Copy link

vercel bot commented Jun 1, 2025

@fzzv is attempting to deploy a commit to the Retro UI Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 1, 2025

Walkthrough

The changes update several UI components to replace hardcoded color classes (such as border-black and bg-white) with theme-based or variable-driven classes (like border-border and bg-background). These updates affect the styling of select, tab, textarea, and toggle components, as well as their usage in preview components, without altering component logic or exported APIs.

Changes

File(s) Change Summary
components/retroui/Select.tsx, components/retroui/Tab.tsx, components/retroui/Toggle.tsx Replaced hardcoded color classes (e.g., border-black, bg-white) with theme-based classes (e.g., border-border, bg-background, secondary).
components/retroui/Textarea.tsx Switched to using a utility function for class names; updated border and placeholder color classes.
preview/components/tab-style-default.tsx Refactored to use custom tab components instead of Headless UI; removed explicit inline styling.
preview/components/textarea-style-default.tsx Replaced native <textarea> with custom Textarea component; removed explicit border color class.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UIComponent
    participant Theme

    User->>UIComponent: Interacts with Select/Tab/Toggle/Textarea
    UIComponent->>Theme: Apply theme-based color classes
    Theme-->>UIComponent: Provide dynamic colors (border, background, etc.)
    UIComponent-->>User: Rendered with updated, theme-consistent styles
Loading

Possibly related PRs

Poem

A border once black, now theme-aware,
Components styled with thoughtful care.
Tabs and selects, their colors align,
Textareas and toggles, all look divine.
With every class, a rabbit hops,
Bringing harmony to UI shops! 🐇🎨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (1)
components/retroui/Select.tsx (1)

17-20: Consistent theme-based styling for SelectTrigger

Replaced hardcoded border and background classes with border-border and bg-transparent to align with theme tokens for dark mode. Approve this update.
Consider whether the border-input class is still required or if it could be removed to avoid redundant border-color definitions.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68097bd and e364db3.

📒 Files selected for processing (6)
  • components/retroui/Select.tsx (2 hunks)
  • components/retroui/Tab.tsx (2 hunks)
  • components/retroui/Textarea.tsx (2 hunks)
  • components/retroui/Toggle.tsx (1 hunks)
  • preview/components/tab-style-default.tsx (1 hunks)
  • preview/components/textarea-style-default.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
components/retroui/Tab.tsx (1)
lib/utils.ts (1)
  • cn (4-6)
preview/components/textarea-style-default.tsx (1)
components/retroui/Textarea.tsx (1)
  • Textarea (4-21)
components/retroui/Textarea.tsx (1)
lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (10)
components/retroui/Toggle.tsx (1)

18-18: Excellent dark theme improvement!

The solid variant now uses semantic color tokens (secondary, secondary-foreground) instead of hardcoded colors, which will properly adapt to both light and dark themes. This change maintains visual consistency while improving accessibility.

preview/components/textarea-style-default.tsx (2)

1-1: Good migration to custom component.

Adding the import for the custom Textarea component aligns with the project's component architecture.


5-8: Excellent theming consistency improvement!

Replacing the native <textarea> with the custom <Textarea> component and removing the hardcoded border-black class ensures consistent theming. The custom component (from the relevant code snippet) uses border-border which properly adapts to dark themes.

components/retroui/Textarea.tsx (2)

2-2: Good addition of utility function.

Adding the cn utility import enables proper class name composition and merging, which is essential for theme-aware styling.


14-17: Excellent theming improvements!

The changes implement several best practices for dark theme support:

  1. Better class composition: Using cn() instead of template literals provides better Tailwind class merging
  2. Theme-aware border: Replacing border-black with border-border ensures proper adaptation to light/dark themes
  3. Enhanced placeholder styling: Adding placeholder:text-muted-foreground improves readability in both themes

These changes significantly improve the component's theming capabilities while maintaining backward compatibility.

components/retroui/Tab.tsx (2)

38-38: Perfect theming improvement for selected tab state.

Replacing data-selected:border-black with data-selected:border-border ensures the selected tab border adapts properly to both light and dark themes, maintaining visual hierarchy and accessibility.


54-54: Consistent theming for tab content.

Updating the border from border-black to border-border maintains visual consistency with other components and ensures proper dark theme support for the tab content panel.

components/retroui/Select.tsx (1)

44-49: Apply theme-based border and background in SelectContent

Switching from fixed border-black/bg-white to border-border/bg-background ensures the dropdown content adapts to the dark theme while preserving existing animations and layout.

preview/components/tab-style-default.tsx (2)

1-3: Use custom Tabs components from retroui

Updated import to use the new Tabs API from @/components/retroui/Tab instead of Headless UI’s Tab* components. This change is consistent with the underlying component refactor.


5-19: Refactor TabStyleDefault to the new Tabs API

The JSX structure now leverages Tabs, TabsTriggerList, TabsTrigger, TabsPanels, and TabsContent, preserving the original tab semantics and content. This adoption maintains feature parity while benefiting from the updated theming and styling in the custom Tab components.

@ariflogs ariflogs merged commit 121a18d into Logging-Studio:main Jun 1, 2025
1 of 2 checks passed
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