Add Custom Theme and Color Customization Feature #1368
+1,634
−8
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.
Description
This PR implements a comprehensive custom theme and color customization system for Freelens, addressing issue #1280. Users can now create, edit, duplicate, delete, import, and export custom themes with full control over all UI colors.
Changes
Core Theme System Enhancements
Extended Theme Interface
isCustomflag toLensThemeinterface to distinguish user-created themes from built-in onesCustom Theme Storage
custom-themes-storage.injectable.tsfor persistent storage of custom themeslens-custom-themes.json)Theme Validation
theme-validation.tswith comprehensive validation utilitiescolorlibraryTheme Manager Service
custom-theme-manager.injectable.tsas the main API for theme operationsUser Interface Components
Color Picker Component (New Package:
@freelensapp/color-picker)Theme Editor
custom-theme-editor.tsxfor full-featured theme editingEnhanced Theme Preference UI
theme.tsxwith buttons for theme operationsImport/Export Functionality
import-export-theme.tsxfor theme sharingExtension API
registerTheme()function for extensions to provide custom themesunregisterTheme()for cleanupgetThemes()to retrieve all available themesThemenamespace in the renderer APIArchitecture Improvements
Reactive Theme System
themes.injectable.tsto combine built-in and custom themes reactivelyactive.injectable.tsto support custom themesFixed Default Theme ID
defaultThemeIdfrom"lens-dark"to"Dark"to match actual theme nameUsers can now:
Closes #1280