-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: replace isDark conditional logic with Tailwind dark: prefix across 19 components (250+ conversions) #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@copilot use pnpm instead of npm. please fix all isDark to dark prefix. Read the comments in relative issue, ensure pnpm format:check and pnpm lint-staged is successful when you want to commit the git.Do not edit about and admin/content pages and components. |
…tion-bar component Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…tion-history component Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…ing-controller and input-area components Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…tion-bar component Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…n chatflow-node-tracker, image-preview, text-generation-tracker, and audio-preview components Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…n all file-preview components (text, video, pdf, markdown) Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
…viewer, history components, and mobile UI components Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
…le and history components - Replace remaining false conditional logic with Tailwind dark: prefix in history-selection-bar - Complete mobile user button dark mode implementation with proper dark: classes - Fix user bottom sheet dark mode styling consistency - Clean up unused variables in api-config-store for better code quality - Ensure all dark mode styles use semantic Tailwind classes instead of conditional logic This completes the dark mode refactoring for mobile UI components and history selection bar, providing consistent dark theme support across the application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR systematically replaces runtime isDark conditional logic with Tailwind CSS's dark: prefix pattern across 19 components, improving performance and maintainability while following Tailwind CSS v4 best practices.
Key Changes:
- Eliminated
useTheme()anduseThemeColors()hook dependencies from all converted components - Replaced conditional class generation with static Tailwind dark mode classes
- Removed
isDarkparameters from component interfaces where applicable
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/stores/api-config-store.ts | Removed unused variable assignments for clean code |
| components/workflow/workflow-tracker/execution-bar.tsx | Converted complex workflow execution status styling with 25+ conversions |
| components/workflow/execution-history/index.tsx | Replaced theme hook usage with dark mode classes |
| components/text-generation/text-generation-viewer.tsx | Updated text generation interface styling |
| components/text-generation/text-generation-tracker.tsx | Converted markdown rendering and streaming indicators |
| components/mobile/ui/user-bottom-sheet.tsx | Updated mobile user interface with 13+ conversions |
| components/mobile/mobile-user-button.tsx | Simplified mobile navigation button styling |
| components/history/index.tsx | Updated main history page styling |
| components/history/history-selection-bar.tsx | Converted selection interface styling |
| components/history/history-list.tsx | Heavy refactoring with 15+ conditional statements |
| components/file-preview/previews/* | Updated all 6 file preview components |
| components/chatflow/chatflow-node-tracker.tsx | Converted real-time node progress display |
| components/chatflow/chatflow-input-area.tsx | Complex form fields with 22+ conversions |
| components/chatflow/chatflow-floating-controller.tsx | Simple floating button component |
| components/chatflow/chatflow-execution-bar.tsx | Advanced component with 30+ conversions and interface refactoring |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
… across 19 components (250+ conversions) (iflabx#240) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zhangxuhe1 <xuhezhang6@gmail.com>
This PR systematically replaces runtime
isDarkconditional logic with Tailwind CSS'sdark:prefix pattern across 19 components, addressing performance and maintainability issues while following Tailwind CSS v4 best practices.Problem
The codebase was using runtime
useTheme()hooks withisDarkconditional logic throughout components for dark mode theming:This created several issues:
useTheme()added runtime checksSolution
Replaced all conditional logic with Tailwind's
dark:prefix pattern:Components Converted (19 total)
Workflow Components (2)
workflow-tracker/execution-bar.tsx- Complex execution bars with status indicatorsexecution-history/index.tsx- Mixed theme colors and conditional patternsChatflow Components (3)
chatflow-floating-controller.tsx- Simple floating button componentchatflow-input-area.tsx- Complex form fields with gradients and error states (22+ conversions)chatflow-execution-bar.tsx- Advanced component with sub-components requiring interface refactoring (30+ conversions)chatflow-node-tracker.tsx- Real-time node progress display with complex conditional stylingFile Preview Components (6)
file-preview/previews/image-preview.tsx- Image display with download functionalityfile-preview/previews/audio-preview.tsx- Audio player interface with metadata displayfile-preview/previews/text-preview.tsx- Text content viewer with copy/download actionsfile-preview/previews/video-preview.tsx- Video player with controls and file informationfile-preview/previews/pdf-preview.tsx- PDF document viewer with embedded displayfile-preview/previews/markdown-preview.tsx- Markdown renderer with syntax highlightingText Generation Components (2)
text-generation/text-generation-tracker.tsx- Most complex component with markdown rendering, streaming indicators (25+ conversions)text-generation/text-generation-viewer.tsx- Text display and editing interface (17+ conversions)History & Mobile Components (6)
history/index.tsx- Main history page with search and conversation managementhistory/history-list.tsx- Heavy usage with 15+ conditional statements for list stylinghistory/history-selection-bar.tsx- Selection interface for batch operationsmobile/ui/user-bottom-sheet.tsx- Mobile user interface (13+ conversions)mobile/mobile-user-button.tsx- Mobile navigation button stylingRefactoring Patterns Applied
useTheme()anduseThemeColors()dependencies from 19 componentsisDarkparameters from component interfaces where neededBenefits Achieved
Technical Details
isDarkconditional statementsisDarkreferences left in non-admin/non-about componentspnpm format:checkandpnpm lint-stagedvalidationsTesting
pnpm type-check)The refactoring maintains exact visual appearance and functionality while following Tailwind CSS best practices for significantly better performance and maintainability.
Fixes #220.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.