Skip to content

TP-23 — Import custom themes into user themes directory #118

Description

@ZhuchkaTriplesix

Epic: D
Depends on: TP-12, TP-21

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

Goal

Make Import theme… add themes to registry instead of only overwriting one imported.json.

Files

  • lib/core/theme/theme_registry_service.dart
  • lib/core/theme/theme_import_service.dart
  • lib/features/settings/preferences_appearance_section.dart

Implementation

Add:

Future<ThemeDefinitionImportResult> importThemeFile(String sourcePath)

Behavior:

  • detect Querya custom vs VS Code;
  • validate;
  • copy into app support themes directory;
  • filename should be stable and safe:
    • ${id}.json for custom;
    • slugified name for VS Code;
  • avoid overwrite:
    • if same id/hash exists, reuse;
    • if same id different hash, append suffix or replace only after explicit policy;
  • return new ThemeDefinition.

Acceptance Criteria

  • Importing custom theme adds it to picker.
  • Importing VS Code theme still works.
  • Multiple imported themes can coexist.
  • Old single imported flow still works until fully migrated.

Tests

  • import custom;
  • import VS Code;
  • duplicate import same hash;
  • duplicate id different content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    filesystemTheme parser epic label: filesystemsettingsTheme parser epic label: settingsthemeTheming, colors, VS Code themes

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions