Epic: B
Depends on: TP-13, TP-15, TP-16
Source: docs/theme-parser-github-issues.md
Goal
Make ThemeController aware of registry themes while preserving existing presets.
Files
lib/core/theme/theme_controller.dart
lib/core/theme/querya_theme_preset.dart
- tests for theme controller.
Implementation
Add state:
_availableThemes: List<ThemeDefinition>
_selectedThemeId: String?
_selectedThemePath: String?
_selectedThemeLoadError: String?
Add getters:
availableThemes
selectedThemeId
selectedThemeLoadError
Add methods:
Future<void> loadAvailableThemes();
Future<void> setThemeById(String id);
Future<ThemeLoadResult> previewThemeById(String id);
Behavior:
load() first loads existing mode/preset.
- Then load registry definitions async.
- If stored selected id exists, try load it.
- On failure, apply Querya Dark fallback but keep error visible.
Performance Notes
- Do not call
notifyListeners() for every discovered file.
- Batch registry load and notify once.
previewThemeById must not mutate active app theme.
Acceptance Criteria
- Existing
setPreset() behavior still works.
- New
setThemeById() applies registry theme.
- Broken selected theme falls back to Querya Dark.
previewThemeById() returns theme/result without notifying app listeners.
Tests
- old presets still pass;
- select by id persists setting;
- preview does not change
activeTheme;
- broken selected id fallback.
Epic: B
Depends on: TP-13, TP-15, TP-16
Source:
docs/theme-parser-github-issues.mdGoal
Make
ThemeControlleraware of registry themes while preserving existing presets.Files
lib/core/theme/theme_controller.dartlib/core/theme/querya_theme_preset.dartImplementation
Add state:
_availableThemes: List<ThemeDefinition>_selectedThemeId: String?_selectedThemePath: String?_selectedThemeLoadError: String?Add getters:
availableThemesselectedThemeIdselectedThemeLoadErrorAdd methods:
Behavior:
load()first loads existing mode/preset.Performance Notes
notifyListeners()for every discovered file.previewThemeByIdmust not mutate active app theme.Acceptance Criteria
setPreset()behavior still works.setThemeById()applies registry theme.previewThemeById()returns theme/result without notifying app listeners.Tests
activeTheme;