Skip to content

feat(desktop): flag already-installed themes in the install pickers - #55410

Merged
OutThisLife merged 1 commit into
mainfrom
bb/install-theme-dedupe
Jun 30, 2026
Merged

feat(desktop): flag already-installed themes in the install pickers#55410
OutThisLife merged 1 commit into
mainfrom
bb/install-theme-dedupe

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

Going to Cmd-K → "Install theme…" listed VS Code Marketplace themes with no indication you already had them, and clicking one re-downloaded + re-installed a theme you already owned. The Appearance settings grid already detected installed themes — but by parsing theme descriptions inline on every render, plumbing that never reached the palette.

This lifts that detection into one reactive source and reuses it on both surfaces:

  • $marketplaceInstalls (computed over $userThemes): extensionId → installed theme, derived once via marketplaceIdOf and memoized — instead of rebuilding a Set on every render.
  • Both install surfaces now mark owned rows as installed (the ✓ "installed" state) and, on click, re-activate the installed theme instead of re-fetching it.
  • Removes the duplicated description-parsing in settings and the per-session "installed here" state in both surfaces. The store is the source of truth now, so themes installed in a previous session show as installed too (the old session-flag missed those).

Why this shape

  • DRY / "use the plumbing": one selector in themes/user-themes.ts (where installed themes already live) replaces two ad-hoc derivations.
  • Performance: memoized computed recomputes only when $userThemes changes, vs. a fresh Set/parse per render; clicking an installed theme is now a store lookup + activate instead of a network download + unzip + convert.

Files

  • themes/user-themes.tsmarketplaceIdOf() + $marketplaceInstalls selector.
  • app/command-palette/marketplace-theme-page.tsx — mark installed; activate-on-click.
  • app/settings/appearance-settings.tsx — consume the shared selector; drop inline parsing + session state.
  • themes/user-themes.test.ts — coverage for the new selector.

Test plan

  • vitest run --environment jsdom themes/user-themes.test.ts — 9 passed
  • tsc -p . --noEmit — clean
  • eslint on all touched files — clean
  • Manual: install a theme from the Cmd-K palette → it shows ✓ installed; reopen the palette and the same theme reads installed; clicking it just re-activates (no network). Same row state mirrored in Appearance settings.

The Cmd-K "Install theme…" palette listed Marketplace themes with no hint
that you already had them, and clicking one re-downloaded + re-installed a
theme you owned. The Appearance settings grid already detected this, but by
parsing theme descriptions inline on every render — plumbing that never made
it to the palette.

Lift it into one reactive source and reuse it everywhere:
- $marketplaceInstalls (computed over $userThemes): extensionId -> installed
  theme, derived once via marketplaceIdOf and memoized, instead of rebuilding
  a Set per render.
- Both install surfaces now mark owned rows installed and, on click,
  re-activate the installed theme rather than re-fetching it.
- Drops the duplicated description-parsing in settings and the per-session
  "installed here" state in both surfaces (the store is the source of truth,
  so previously-installed themes show correctly too).
@OutThisLife
OutThisLife enabled auto-merge June 30, 2026 04:30
@OutThisLife
OutThisLife merged commit 972b162 into main Jun 30, 2026
20 checks passed
@OutThisLife
OutThisLife deleted the bb/install-theme-dedupe branch June 30, 2026 04:34
@alt-glitch alt-glitch added type/feature New feature or request comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have labels Jun 30, 2026
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…eme-dedupe

feat(desktop): flag already-installed themes in the install pickers
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
…eme-dedupe

feat(desktop): flag already-installed themes in the install pickers
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…eme-dedupe

feat(desktop): flag already-installed themes in the install pickers
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…eme-dedupe

feat(desktop): flag already-installed themes in the install pickers
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…eme-dedupe

feat(desktop): flag already-installed themes in the install pickers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants