refactor(panels): co-locate panel kind modules into src/panels/#5015
Merged
gregpriday merged 2 commits intodevelopfrom Apr 7, 2026
Merged
refactor(panels): co-locate panel kind modules into src/panels/#5015gregpriday merged 2 commits intodevelopfrom
gregpriday merged 2 commits intodevelopfrom
Conversation
…tory
- Create src/panels/{terminal,agent,browser,notes,dev-preview}/ with serializer.ts, defaults.ts, index.ts per kind
- Create src/panels/registry.tsx as unified renderer registry with initBuiltInPanelKinds() bootstrap
- Strip serialize/createDefaults from shared/config/panelKindRegistry.ts built-in entries (metadata only)
- Convert src/registry/panelKindRegistry.tsx to re-export shim from src/panels/registry
- Move serialize tests to src/panels/__tests__/registry.serialization.test.ts
- Move createDefaults tests to src/panels/__tests__/registry.defaults.test.ts
- Add src/panels/__tests__/registry.init.test.ts for idempotency
- Add initBuiltInPanelKinds() to test files that depend on serialize/createDefaults
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/panels/with a subdirectory per kind (terminal,agent,browser,notes,dev-preview), each exporting its serializer, defaults factory, and aPanelKindDefinitionsrc/panels/registry.tsxbecomes the single import point that registers all kinds, replacing the scattered logic acrosspanelKindRegistry.tsand the renderer registrypanelKindRegistry.tsand rendererpanelKindRegistry.tsxare slimmed down to thin wrappers, with per-kind logic now living alongside the kind it belongs toResolves #5006
Changes
src/panels/{terminal,agent,browser,notes,dev-preview}/modules withindex.ts,serializer.ts, anddefaults.tsper kindsrc/panels/registry.tsxas the central registration point, imported insrc/main.tsxshared/config/panelKindRegistry.tsandsrc/registry/panelKindRegistry.tsxto lightweight stubssrc/panels/__tests__/Testing
Unit tests pass. The existing registry serialization and defaults test suites were moved into
src/panels/__tests__/and continue to cover the same behaviour — both the init and defaults tests are new additions verifying kind registration and factory outputs.