Skip to content

refactor(plugins): extract the shared content-pack registry and list store - #30697

Merged
nwparker merged 4 commits into
mainfrom
nwparker/refactor-plugin-pack-registries
Oct 19, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/refactor-plugin-pack-registries

Conversation

@nwparker

@nwparker nwparker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​32 $\color{#cf222e}{\Huge{\mathbf{−}}}$​30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​269 $\color{#cf222e}{\Huge{\mathbf{−}}}$​227 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42

ELI5

Language packs are the only plugin "content pack" today, and their loading code is written specifically for them. This pulls the reusable parts out so the next kinds of pack (themes, icon themes, terminal themes) reuse them instead of copying ~300 lines each. Nothing a user sees changes.

What Changed

  • plugin-artifact-pack-registry.ts: the verify → bounded read → parse → per-plugin error loop, extracted from plugin-language-pack-registry.ts; language packs are now one instance of it.
  • plugin-content-pack-registry.ts: content families reconcile and report errors from one list, so a new family is one line.
  • plugin-artifact-validation.ts / plugin-manifest.ts: declared artifact paths and the contributes default come from one table per family instead of repeated field lists.
  • store/plugin-content-list-store.ts: the renderer list store (fetch generation, startup join window, change subscription) extracted from the language-pack store. Its fields are named entries / fetchEntries; the two hooks reading it are updated.

Loading order, errors, the startup join window and change subscription behave exactly as before.

Why

Theme, icon-theme and terminal-theme packs are next. Without this, each would be a near-copy of the language-pack registry and store. Extracting now keeps those PRs about the new behavior.

Linked Issue

N/A (maintainer refactor).

Visual Proof

N/A — no UI or behavior change.

Testing

  • Plugin, shared, store and hook suites pass (712 files, 6,289 tests); test edits are only the mechanical field rename. pnpm tc:node, tc:web, oxlint, check:code-quality:changed, localization coverage clean.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Behavior-preserving: no change for Linux/Windows/macOS, SSH, mobile, or older clients.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Pure refactor. Verify, bounded read, parse and per-plugin error handling
move into PluginArtifactPackRegistry; language packs become one instance,
so later data families reuse it instead of copying the file.
Pure refactor. Reconcile and error reporting walk one family list in the
same order as before, so a new family is one entry.
…defaults

Pure refactor. Declared artifact paths are a list of per-family rows, and
the contributes default comes from the schema (prefault) instead of a
second copy of the field list; the existing defaults test pins the result.
Pure refactor. The fetch generation, startup join window and content-change
subscription move into createPluginContentListStore; language packs become
one instance, and store fields are renamed to entries/fetchEntries.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ca7c7f7a-f9e9-428d-a183-2f058893ee50
📥 Commits

Reviewing files that changed from the base of the PR and between a12c592 and 0b6222c.

📒 Files selected for processing: 13
  • src/main/plugins/plugin-artifact-pack-registry.ts
  • src/main/plugins/plugin-artifact-validation.ts
  • src/main/plugins/plugin-content-pack-registry.ts
  • src/main/plugins/plugin-language-pack-registry.ts
  • src/renderer/src/hooks/useMacTccAttributionSeveredNotice.test.tsx
  • src/renderer/src/hooks/useMacTccAttributionSeveredNotice.ts
  • src/renderer/src/hooks/useMacosTccPromptNotice.test.tsx
  • src/renderer/src/hooks/useMacosTccPromptNotice.ts
  • src/renderer/src/store/plugin-content-list-store.ts
  • src/renderer/src/store/plugin-language-packs-startup.test.ts
  • src/renderer/src/store/plugin-language-packs.test.ts
  • src/renderer/src/store/plugin-language-packs.ts
  • src/shared/plugins/plugin-manifest.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

📝 Walkthrough

The changes add a shared registry for verifying and loading plugin contributions, and update backend content-family reconciliation. A reusable renderer store now handles content-list fetching and validation. Language-pack state, notice hooks, and tests now use the store’s entries collection. The manifest contribution fallback and artifact path collection are also updated.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 0b622

The language-pack fetch remains functional, and no actionable merge-blocking issue is established. The change is ready for normal merge checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 13 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: extracting shared content-pack registry and list-store logic.
Description check Passed The description follows the required structure and explains the change, rationale, testing, visual impact, compatibility considerations, and checklist status. The maintainer-specific Linked Issue exce…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description follows the required structure and explains the change, rationale, testing, visual impact, compatibility considerations, and checklist status. The maintainer-specific Linked Issue exception is addressed with N/A, and Visual Proof correctly states N/A because there is no UI change.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 92ed331 into main Oct 19, 2026
37 of 38 checks passed
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.

1 participant