Conversation
Co-authored-by: Nittarab <6181406+Nittarab@users.noreply.github.com>
Nittarab
left a comment
There was a problem hiding this comment.
@copilot use the phospor icon, remove the SVG stuff
Co-authored-by: Nittarab <6181406+Nittarab@users.noreply.github.com>
Co-authored-by: Nittarab <6181406+Nittarab@users.noreply.github.com>
|
@copilot run then ensure the |
Co-authored-by: Nittarab <6181406+Nittarab@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #31 +/- ##
==========================================
- Coverage 99.67% 99.51% -0.17%
==========================================
Files 68 71 +3
Lines 1870 2067 +197
Branches 129 166 +37
==========================================
+ Hits 1864 2057 +193
- Misses 6 10 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Nittarab
left a comment
There was a problem hiding this comment.
@copilot
We can improve the approach of the theme controller component. Even if there are different previews with different types, we can use a tag.(type:) (check rails doc)
and paste the type of the tag and all the attributes that are currently manipulated for that type.
| /test/dummy/log/*.log | ||
| /test/dummy/storage/ | ||
| /test/dummy/tmp/ | ||
| /vendor/ |
There was a problem hiding this comment.
Reverted the .gitignore change to remove the /vendor/ entry in commit f0ede5a.
| def theme_controller_using_a_checkbox | ||
| render_with_template | ||
| end | ||
|
|
||
| # Theme Controller using a Toggle | ||
| # --------------- | ||
| # Toggle switch for theme switching | ||
| def theme_controller_using_a_toggle | ||
| render_with_template | ||
| end | ||
|
|
||
| # Theme Controller using a Radio Input | ||
| # --------------- | ||
| # Radio inputs with labels for theme selection | ||
| def theme_controller_using_a_radio_input | ||
| render_with_template | ||
| end | ||
|
|
||
| # Theme Controller using a Radio Button | ||
| # --------------- | ||
| # Radio inputs styled as buttons | ||
| def theme_controller_using_a_radio_button | ||
| render_with_template | ||
| end | ||
|
|
||
| # Theme Controller using a Dropdown | ||
| # --------------- | ||
| # Dropdown menu with theme options | ||
| def theme_controller_using_a_dropdown | ||
| render_with_template | ||
| end | ||
|
|
||
| # Theme Controller using a Swap | ||
| # --------------- | ||
| # Swap component with sun/moon icons | ||
| def theme_controller_using_a_swap | ||
| render_with_template | ||
| end | ||
|
|
||
| # Theme Controller using a Toggle with Icons | ||
| # --------------- | ||
| # Toggle with sun and moon icons | ||
| def theme_controller_using_a_toggle_with_icons | ||
| render_with_template(locals: { helper: self }) | ||
| end | ||
|
|
||
| # Theme Controller using a Toggle with Text | ||
| # --------------- | ||
| # Toggle with text labels before and after | ||
| def theme_controller_using_a_toggle_with_text | ||
| render_with_template | ||
| end | ||
|
|
||
| # Theme Controller using a Toggle with Custom Colors | ||
| # --------------- | ||
| # Toggle with custom Tailwind color classes | ||
| def theme_controller_using_a_toggle_with_custom_colors | ||
| render_with_template | ||
| end |
There was a problem hiding this comment.
There is no need to render with a template these previews render them inline
There was a problem hiding this comment.
Converted all preview methods from template-based rendering to inline component rendering and removed the unnecessary template files in commit f0ede5a.
Co-authored-by: Nittarab <6181406+Nittarab@users.noreply.github.com>
Co-authored-by: Nittarab <6181406+Nittarab@users.noreply.github.com>
Improved the ThemeController component approach using Rails' tag helper more effectively in commit 2028fb1. Now uses unified |
This PR implements a new
ThemeControllercomponent that provides comprehensive support for DaisyUI's theme switching functionality. The component follows the established patterns in the repository and supports all the theme controller variations found in DaisyUI.Features
The
ThemeControllercomponent supports multiple input types for theme switching:Usage Examples
Implementation Details
checked="false"rather than including it)IconsHelpermodule, eliminating hardcoded SVG contentPreviewTestConcernThe component generates HTML that exactly matches the expected DaisyUI theme controller patterns and includes a playground preview for interactive testing of all features. The implementation uses a unified approach with Rails tag helpers to minimize code duplication and improve maintainability.
Fixes #30.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.