Skip to content

TP-12 — Implement filesystem theme scan #107

Description

@ZhuchkaTriplesix

Epic: B
Depends on: TP-10, TP-11

Source: docs/theme-parser-github-issues.md

Goal

Scan app support theme folder and return lightweight ThemeDefinition objects.

Files

  • lib/core/theme/theme_registry_service.dart
  • test/core/theme/theme_registry_service_test.dart

Implementation

Add:

class ThemeRegistryService {
  Future<List<ThemeDefinition>> loadThemeDefinitions();
}

For .json and .jsonc files:

  1. Read file async.
  2. Detect format:
    • if root schema == querya.theme.v1 -> custom;
    • otherwise try VS Code manifest.
  3. Extract only metadata:
    • id
    • name
    • type/isDark
    • format
    • path
    • lastModified
    • contentHash
  4. Skip broken files from list or return a disabled/error definition. Prefer disabled/error definition if UI should show it later.

Performance Notes

  • Do not construct QueryaTheme.
  • Do not construct ThemeData.
  • Hash file content once during scan.
  • Async file IO only.

Acceptance Criteria

  • Valid custom files appear.
  • Valid VS Code files appear.
  • Broken file does not crash scan.
  • Only .json / .jsonc are considered.

Tests

  • temp dir with 2 valid themes and 1 broken;
  • stable ordering by name;
  • content hash changes when file changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    filesystemTheme parser epic label: filesystemperformanceTheme parser epic label: performancethemeTheming, colors, VS Code themes

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions