Skip to content

feat(desktop): import VS Code color themes - #207

Open
lihuiyang1024 wants to merge 1 commit into
HKUDS:mainfrom
lihuiyang1024:feat/vscode-theme-import
Open

feat(desktop): import VS Code color themes#207
lihuiyang1024 wants to merge 1 commit into
HKUDS:mainfrom
lihuiyang1024:feat/vscode-theme-import

Conversation

@lihuiyang1024

Copy link
Copy Markdown
Contributor

Description

Closes #152.

Implements the bounded VS Code theme-import contract agreed in the issue: one local standalone JSON/JSONC color-theme file, no package discovery or include traversal, mapped into the existing Appearance theme system.

Behavior

  • imported is a regular ThemePreference and uses data-theme="imported"
  • every imported palette is complete: unmapped values are filled from an inferred light/dark base
  • only the normalized 32-token palette, base, and display name are persisted; the path and raw source are discarded
  • all colors values must use VS Code's hexadecimal color notation
  • invalid JSONC, invalid colors, files over 1 MB, and include chains produce a visible error without replacing the current theme
  • syntax tokenColors, extension packages, and include resolution are deliberately outside this first version

Changes Made

  • add a pure JSONC parser/normalizer and documented VS Code-to-DeepCode token mapping
  • derive translucent accent states and valid box-shadow declarations from imported colors
  • add an import control, persisted imported-theme option, status, errors, and zh-CN copy to Settings → Appearance
  • add a minimal imported-theme CSS selector through the existing theme mechanism
  • pin the light/dark fallback copies to tokens.css in tests so they cannot drift or become incomplete
  • document the local-only trust and persistence boundary in desktop/README.md

Verification

  • npm run typecheck
  • npm run lint
  • focused import/appearance/token/UI tests — 96 passed
  • npm test — 32 files, 207 tests passed
  • npm run build

Checklist

  • Changes tested locally
  • Code reviewed
  • Documentation updated
  • Unit tests added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add theme support (dark mode + VS Code theme import) in Desktop GUI

1 participant