Skip to content

TP-17 — Integrate registry into ThemeController load #112

Description

@ZhuchkaTriplesix

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    controllerTheme parser epic label: controllerthemeTheming, colors, VS Code themes

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions