Skip to content

chore(themes): drop dead PREFERRED_THEME_ORDER sort from bundler - #335

Merged
nedtwigg merged 1 commit into
mainfrom
chore/drop-dead-theme-sort
Aug 2, 2026
Merged

chore(themes): drop dead PREFERRED_THEME_ORDER sort from bundler#335
nedtwigg merged 1 commit into
mainfrom
chore/drop-dead-theme-sort

Conversation

@dormouse-bot

Copy link
Copy Markdown
Collaborator

What

Removes the dead PREFERRED_THEME_ORDER list and the allThemes.sort(...) that consumed it from the theme-bundling generator.

Why

PREFERRED_THEME_ORDER contained a single id — GitHub.github-vscode-theme.github-dark-default — but that extension was removed from EXTENSIONS in cd248fa ("Only ship OpenVSX themes"), so the id is never present in the fetched theme set. Every PREFERRED_THEME_ORDER.indexOf(...) therefore returns -1, the comparator always returns 0, and the sort is a complete no-op that only reorders relative to a theme that no longer exists.

The sort was there to pin a preferred theme first, because getBundledThemes()[0] is the default-theme fallback (getActiveThemeId() in lib/src/lib/themes/store.ts). With the pinned theme gone, that mechanism is inert leftover from the OpenVSX-only cleanup.

Behavior

No change. The sort is currently a no-op, so bundled.json ordering is untouched — the default remains vscode.theme-defaults.dark-visual-studio, a dark theme consistent with the "Dark default theme fallback" noted in docs/specs/theme.md. bundled.json was not regenerated because the output is byte-identical.

If a specific default is wanted in the future, re-introduce an explicit ordering keyed on an id that is actually bundled — the removed version pointed at one that isn't.

Testing

No regression test: this deletes a no-op, so there is no behavioral delta to assert. The invariant — bundled.json unchanged — is verified by the committed output being untouched. node --check confirms the script still parses; PREFERRED_THEME_ORDER has no remaining references.

Found during the nightly code-quality sweep.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8b9d1a3
Status: ✅  Deploy successful!
Preview URL: https://fecf8431.mouseterm.pages.dev
Branch Preview URL: https://chore-drop-dead-theme-sort.mouseterm.pages.dev

View logs

@nedtwigg
nedtwigg merged commit a1d59d3 into main Aug 2, 2026
7 checks passed
@nedtwigg
nedtwigg deleted the chore/drop-dead-theme-sort branch August 2, 2026 08:10
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.

2 participants