feat(web): import themes from local .vsix extension packages - #8419
feat(web): import themes from local .vsix extension packages#8419ipanasenko wants to merge 2 commits into
Conversation
A paid or private VS Code theme the user already owns has no import path: the dialog only accepts loose JSON files, and Open VSX only carries open-source extensions. Extract the VSIX/ZIP machinery from openVsxThemes.ts into vsixThemePackage.ts and reuse it for local files. A dropped or picked .vsix imports every contributed color theme as one collection, so re-importing the same extension offers an update instead of piling up copies. Local packages skip the registry-only gates (license allowlist, checksum) but keep every archive-safety limit. The desktop picker lists .vsix and sends package bytes base64-encoded over IPC.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
A .vsix could grow between stat and readFile, pulling an arbitrarily large archive into main-process memory before the renderer rejected it. Read through a bounded loop that stops past the cap instead.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a substantial local You can add or adjust custom eligibility rules. Learn more. |
Problem
A theme the user already owns as a
.vsixfile (paid themes like Dracula Pro, private packages, anything not on Open VSX) has no import path. The Add a theme dialog accepts loose T3 Code / VS Code.jsonfiles, and the search only covers open-source Open VSX extensions.Fix
Screen.Recording.2026-08-27.at.6.46.25.PM.mov
============ TEXT BELOW IS GENERATED BY FABLE ========================================
includeresolution, contribution parsing, light/dark pairing) fromopenVsxThemes.tsinto a newvsixThemePackage.tsand rebuild the Open VSX import on top of it, so the two paths cannot drift..vsix. Every contributed color theme imports as one collection, so re-importing the same extension offers an update (with the existing local-edits warning) instead of piling up copies.vsix-theme-) and collection namespace (local-vsix:), so a local import never collides with the same extension installed from Open VSX..vsixand sends package bytes base64-encoded over IPC (PickedThemeFile.contentBase64), matching how other binary crosses the bridge.Surfaces
.vsixper import: a package expands into a collection with its own update prompt, so mixing it into a multi-file JSON batch would need a second conflict flow. Multi-select with a.vsixshows a clear error.docs/user/themes.md, and this feature should be added there once either lands.Note for review: overlaps textually (not logically) with #8063 — that PR hardens the Open VSX network path, this one relocates the ZIP layer it sits on. Whichever lands second rebases mechanically.
Built with Claude (Fable 5) via Claude Code.
Note
Add local
.vsixtheme package import toThemeImportDialogwindow.pickThemeFiles) now accepts.vsixfiles, enforces a 20 MB cap (PICKED_THEME_PACKAGE_MAX_BYTES), and sends binary content base64-encoded via a newcontentBase64field on thePickedThemeFileIPC contract..vsixfiles to single-package import, reads bytes from the file or desktop bridge, and prompts to update when the collection is already installed..vsixfor an already-installed collection replaces it viareplaceCustomThemeCollection, dropping any local edits; only one.vsixmay be imported at a time.Macroscope summarized b02e5cb.
Note
Medium Risk
New ZIP unpacking and IPC binary transfer paths are security-sensitive, though heavily capped; re-importing an existing VSIX collection replaces stored themes and can discard local edits after explicit confirmation.
Overview
Users can import color themes from a local
.vsixextension package (paid or private themes), not only loose JSON or Open VSX search.VSIX ZIP parsing, manifest handling, and theme extraction are moved into shared
vsixThemePackage, and Open VSX import is rewired to use it so both paths stay aligned. Local imports use separate theme ids (vsix-theme-) and collection ids (local-vsix:), skip registry license/checksum checks, and still enforce the same archive size and safety limits.Add a theme accepts one
.vsixat a time via drag-and-drop or file picker; variants install as a single collection, with an update prompt when that collection is already installed (replacing variants and dropping local edits). On desktop, the native picker includes.vsix, reads up to 20 MB with a capped read, and returns binary data as optionalcontentBase64onPickedThemeFile.Reviewed by Cursor Bugbot for commit b02e5cb. Bugbot is set up for automated code reviews on this repo. Configure here.