feat: Custom Panel Plugin SDK & Multi-View Dashboard (#32, #33)#35
feat: Custom Panel Plugin SDK & Multi-View Dashboard (#32, #33)#35
Conversation
Code reviewFound 3 issues:
monitor-forge/monitor-forge.config.json Lines 95 to 97 in 3dbab3b
Lines 128 to 134 in 3dbab3b monitor-forge/src/core/panels/PanelManager.ts Lines 128 to 137 in 3dbab3b
monitor-forge/forge/src/commands/validate.ts Lines 107 to 113 in 3dbab3b monitor-forge/src/core/panels/panel-registry.ts Lines 11 to 13 in 3dbab3b 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
1. Remove manual `views: []` from config (schema default suffices) 2. Add onViewChange callback so view tabs sync on keyboard/hash nav 3. Promote missing customModule to validation error (prevents runtime crash) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…#33) Add two tightly coupled features in a single PR to avoid file conflicts: Custom Panel Plugin SDK (#32): - `forge panel create <name>` scaffolds src/custom-panels/<PascalCase>.ts extending PanelBase with render/update/destroy stubs - Manifest generator auto-imports and registers custom panels by name - panel-registry handles `type: 'custom'` lookup via config.name - PanelSchema gains optional `customModule` field (PascalCase validation) - Validation warns on custom panels missing customModule Multi-View Dashboard (#33): - ViewSchema: name, displayName, panels[], icon?, default? - `forge view add/remove/list/set-default` CLI commands - PanelManager refactored: view containers, switchView(), keyboard shortcuts (1/2/3), URL hash routing (#view=<name>) - View tabs rendered in header alongside existing controls - Panels support appearing in multiple views (Map<string, PanelBase[]>) - Backward compatible: empty views array = current flat sidebar Testing: 473 tests pass, typecheck clean, all presets validate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Remove manual `views: []` from config (schema default suffices) 2. Add onViewChange callback so view tabs sync on keyboard/hash nav 3. Promote missing customModule to validation error (prevents runtime crash) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…a enforcement - Remove redundant active class toggle from tab click handler (onViewChange callback is single source of truth) - Skip panel updates for hidden views to avoid wasted CPU on animations; cache last data and replay on view switch - Add 150ms opacity fade transition between views - Validate panel name format before file operations in `panel create` (prevents path traversal with --no-register) - Pre-validate config before writing scaffold file; rollback on failure - Enforce customModule via Zod refine() for custom panel type - Add ARIA tablist/tab/tabpanel pattern with aria-selected - Add keyboard shortcut hints as tab title tooltips - Improve mobile tab scrolling with hidden scrollbar + touch support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…itching - Add panel command tests (23 tests): create, add, remove, list, name validation, path traversal rejection, --no-register, --dry-run, config rollback on failure - Add view command tests (16 tests): add, remove, list, set-default, panel validation, duplicate rejection, --dry-run - Add view validation tests (6 tests): duplicate views, unknown panels, multiple defaults, orphan panels, customModule enforcement - Add PanelManager view switching tests (9 tests): initializeWithViews, switchView, getActiveView, getViewNames, onViewChange callback, updateAll skips hidden views, destroy cleanup - Fix schema test for custom panel type requiring customModule Total: 492 → 546 tests (+54) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0b5f6ff to
aa315cf
Compare
QA Review & Fixes AppliedPerformed a thorough QA review as a QA engineer. Resolved the merge conflict, fixed all bugs found, added UX/accessibility improvements, and wrote comprehensive test coverage. Merge Conflict Resolution
Bugs Fixed
UX & Accessibility Improvements
Test Coverage
Verification
|
Summary
Two tightly coupled features implemented together to avoid file conflicts across shared code paths (
PanelManager,manifest-generator,schema).Custom Panel Plugin SDK (closes #32)
forge panel create <name>scaffoldssrc/custom-panels/<PascalCase>.tsextendingPanelBasewithrender()/update()/destroy()stubs and JSDocsrc/custom-panels/and registers them by panel namepanel-registryhandlestype: 'custom'lookup viaconfig.nameinstead of literal'custom'PanelSchemagains optionalcustomModulefield with PascalCase validationtype: 'custom'panels missingcustomModuleMulti-View Dashboard Composition (closes #33)
ViewSchema:name,displayName,panels[],icon?,default?forge view add/remove/list/set-defaultCLI commands with full--format json --dry-runsupportPanelManagerrefactored: view containers,switchView(), keyboard shortcuts (1/2/3), URL hash routing (#view=<name>)views[]= current flat sidebar behavior, zero migration neededValidation enhancements
default: trueviews → errorcustomModule→ warningTest plan
npx tsc --noEmit— typecheck cleannpx vitest run— 473/473 tests pass (3 new tests added)forge build --skip-vite— generates 5 manifests (was 4)forge panel create weather— scaffolds file + registers in configforge view add overview --panels tech-news,weather --default— creates viewforge view list— displays views with panel membershipforge validate— passes, warns on orphan panels🤖 Generated with Claude Code