feat!: update module to be compatible with saucebase 2.0 - #8
Merged
Conversation
…e-dev/themes into feat/internachi-modular
Implement themes module with CRUD operations and improve documentation
- Implemented ThemePicker.vue for selecting themes with search functionality. - Created fields.ts to define theme-related fields and their properties. - Developed theme.ts for managing theme application, including font loading and CSS variable handling.
…ePicker, fields, and theme utility files
Add ThemePicker component and improve theme management utilities
There was a problem hiding this comment.
Pull request overview
This PR updates the Themes module for Saucebase 2.0 compatibility by reorganizing backend code under src/, updating module registration/configuration, and refining the theme editor UI (including color-mode persistence and sidebar sync behavior).
Changes:
- Reorganized the module (move PHP sources to
src/, removemodule.json, update Composer/service provider registration, and remove the module RouteServiceProvider). - Enhanced theme editor UX/state handling (sidebar sync logic refinements, new picker/input components, and use of
useColorModewith theappearancestorage key). - Updated tooling and CI metadata (Taskfile, workflow module casing, and E2E coverage for color-mode persistence).
Reviewed changes
Copilot reviewed 16 out of 30 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/index.spec.ts | Adds E2E assertions around color-mode persistence keys/cookie. |
| Taskfile.yml | Updates Playwright project selector casing; adds db seeding task; updates type-gen command casing. |
| src/Services/ThemeService.php | Introduces centralized theme/font discovery and JSON parsing helpers. |
| src/Providers/ThemesServiceProvider.php | Registers console command and shares themes/fonts via Inertia using the new service. |
| src/Http/Controllers/ThemesController.php | Adds REST endpoints for storing/updating/deleting user themes in storage. |
| src/Filament/ThemesPlugin.php | Adds Filament plugin entry for the module. |
| src/Console/Commands/ApplyThemeCommand.php | Adds CLI command to patch theme.css based on a theme JSON definition. |
| routes/web.php | Wraps module routes in web middleware group and keeps CRUD endpoints. |
| resources/js/vue/utils/theme.ts | Minor formatting/indentation adjustments in theme utilities. |
| resources/js/vue/fields.ts | Minor formatting cleanup and sidebar group formatting. |
| resources/js/vue/components/ThemePicker.vue | Updates to use useColorMode({ storageKey: 'appearance' }) and improves trigger styling. |
| resources/js/vue/components/ThemePanel.vue | Switches from useDark to useColorMode, refines sidebar sync detection, and adjusts layout classes. |
| resources/js/vue/components/ThemeColorSwatch.vue | Adds a compact theme preview swatch component. |
| resources/js/vue/components/TailwindColorPicker.vue | Adds a searchable Tailwind palette picker (list/grid). |
| resources/js/vue/components/SliderInput.vue | Adds combined slider + numeric input component for unit fields. |
| resources/js/vue/components/SearchInput.vue | Adds reusable search input with clear control. |
| resources/js/vue/components/LinkToggle.vue | Adds a reusable “linked/unlinked/partial” toggle control with tooltip. |
| resources/js/vue/components/FontPicker.vue | Adds searchable font picker popover. |
| resources/js/vue/components/DialogSave.vue | Adds dialog flow for saving a theme. |
| resources/js/vue/components/DialogCommand.vue | Adds dialog for copying the CLI apply command. |
| resources/js/vue/components/ColorPickerPopover.vue | Adds a full color picker popover with RGB/hex + Tailwind tab. |
| resources/js/vue/components/ColorInput.vue | Adds color input integrating the color picker and cross-mode sync toggle. |
| resources/js/vue/app.ts | Moves Vue entry point under resources/js/vue/ and registers ThemePanel. |
| resources/js/app.ts | Re-exports from the new resources/js/vue/app entry point. |
| module.json | Removes old module metadata file. |
| LICENSE | Updates copyright year. |
| composer.json | Updates package metadata, provider registration, autoload paths, and stability settings. |
| CLAUDE.md | Updates documentation paths and Playwright project casing. |
| app/Providers/RouteServiceProvider.php | Removes unused module RouteServiceProvider. |
| .github/workflows/test.yml | Standardizes workflow module name casing to themes. |
Comments suppressed due to low confidence (1)
resources/js/vue/components/ThemePanel.vue:79
isDarkis computed fromcolorMode.value === 'dark', which ignores the commonautosetting inuseColorMode(). If the stored mode isautoand the system preference is dark, the document can be in dark mode while the ThemePanel still treats it as light, causing it to read/write the wrong mode’s variables.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+6
| "description": "Themes module", | ||
| "type": "saucebase-module", | ||
| "license": "proprietary", | ||
| "version": "1.2.2", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes several updates to the Themes module, focusing on codebase reorganization, improved configuration, and UI/UX refinements. The code has been moved from the
app/to thesrc/directory, and configuration files have been updated to reflect this. There are also improvements to the theme panel's sidebar sync logic, and several naming conventions have been standardized for consistency. Additionally, themodule.jsonfile has been removed, and thecomposer.jsonand workflow/test scripts have been updated.Codebase Reorganization and Configuration Updates:
app/tosrc/, updating all relevant paths in documentation andcomposer.json. [1] [2]module.jsonfile.ThemesServiceProviderincomposer.jsonand set autoloading to use the newsrc/path.RouteServiceProviderclass.Naming and Convention Standardization:
themes) in workflow files, test scripts, and task definitions for consistency. [1] [2] [3]UI/UX and Functional Improvements:
ThemePanel.vueto prevent accidental overwriting of sidebar values and to accurately detect the sync state. [1] [2]useColorModeinstead ofuseDarkfor better color mode handling, and made minor UI adjustments for responsiveness and accessibility. [1] [2] [3]Build and Licensing Updates:
composer.json. [1] [2]LICENSE.Frontend Code Structure:
resources/js/app.tstoresources/js/vue/app.tsand updated imports accordingly. [1] [2]These changes improve the maintainability, consistency, and reliability of the Themes module.