Skip to content

refactor: simplify Inspector architecture#33

Merged
ohing504 merged 4 commits intomainfrom
refactor/simplify-inspector-architecture
Mar 18, 2026
Merged

refactor: simplify Inspector architecture#33
ohing504 merged 4 commits intomainfrom
refactor/simplify-inspector-architecture

Conversation

@ohing504
Copy link
Owner

Summary

  • Remove DashboardDetailTarget discriminated union and toDetailTarget boilerplate from EntityConfig
  • Remove centralized use-entity-action-handler.ts — each Inspector now handles its own actions internally
  • Inspectors receive only itemKey prop, fetch data via cached React Query hooks
  • Selection state simplified from typed union to { type: string; key: string }
  • Add InspectorSkeleton primitive for loading states
  • Preserve Sheet content during close animation via lastSelected ref

Test plan

  • Verify each entity type (skill, agent, mcp, plugin, hook, memory, file) opens Inspector correctly
  • Verify Inspector actions (delete, open in editor) work from within Inspector
  • Verify Sheet close animation shows content (not blank)
  • Verify list context menu actions still work
  • pnpm typecheck && pnpm lint && pnpm test passes

🤖 Generated with Claude Code

ohing504 and others added 4 commits March 18, 2026 21:10
…Target

Remove DashboardDetailTarget discriminated union, toDetailTarget boilerplate,
and centralized use-entity-action-handler. Inspectors now receive only itemKey,
fetch their own data via cached queries, and handle actions internally.
Selection state simplified to { type, key }. Added InspectorSkeleton for
loading states and lastSelected ref to preserve content during Sheet close
animation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…l status logic

Inspector components (agent, mcp, skill) now fall back to plugin contents
when item is not found in standalone queries. Extract resolveInstallStatus
as a pure utility with comprehensive tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- HooksPanel: iterate groups instead of flat allHooks to preserve matcher
  in key generation (matches hookConfig.getKey canonical format)
- PluginsPanel: include matcher + command in hook key (was only scope:event)
- McpInspector: invalidate mcpServers.all instead of agentFiles.all on delete
- Update DESIGN-SYSTEM.md with InspectorSkeleton, InspectorActions, Inspector
  pattern section, and remove DashboardDetailTarget references
- Add Hook Key rules to CONVENTIONS.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ohing504 ohing504 merged commit 042b95e into main Mar 18, 2026
1 check passed
@ohing504 ohing504 deleted the refactor/simplify-inspector-architecture branch March 18, 2026 12:52
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