Skip to content

fix: render SOVD resources for subcomponent entity type#73

Open
bburda wants to merge 1 commit intomainfrom
fix/subcomponent-resource-tabs
Open

fix: render SOVD resources for subcomponent entity type#73
bburda wants to merge 1 commit intomainfrom
fix/subcomponent-resource-tabs

Conversation

@bburda
Copy link
Copy Markdown
Contributor

@bburda bburda commented May 3, 2026

Summary

Subcomponent entities (served via /api/v1/components/{id} after peer aggregation) expose the full SOVD resource set (data, operations, configurations, faults, logs), but the UI rendered only the entity header for them, then fell through to "No detailed information available for this entity." with no tab bar and no fetch.

This change treats 'subcomponent' identically to 'component' for:

  • the resource-count prefetch and fetchEntityData in EntityDetailPanel
  • the tab bar / <ComponentTabContent> render branch
  • the icon and background helpers in the header
  • the getEntityTypeForApi mapping
  • the typeMap in refreshSelectedEntity (so the Refresh button actually re-fetches)

Issue


Type

  • Bug fix
  • New feature
  • Breaking change
  • Documentation only

Testing

  • New EntityDetailPanel.test.tsx mounts the panel with selectedEntity.type === 'subcomponent' and asserts that prefetchResourceCounts is called with 'components' and that the Data / Operations / Config / Faults / Logs buttons render. The test fails on main.
  • Full suite: npm test (404 passed).
  • npm run lint and npm run typecheck are clean.
  • npm run build succeeds; Docker image builds.

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed) - none
  • Linting passes (npm run lint)
  • Build succeeds (npm run build)
  • Docs were updated if behavior or public API changed - no docs change needed

Subcomponent entities served via /api/v1/components/{id} expose the
full resource set (data, operations, configurations, faults, logs) but
EntityDetailPanel and refreshSelectedEntity only branched on
type === 'component', leaving subcomponents with a bare header and the
"No detailed information available" fallback. Treat 'subcomponent' the
same as 'component' for resource fetching, tab rendering, type-icon /
background, and refresh routing.
Copilot AI review requested due to automatic review settings May 3, 2026 11:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the entity detail view so subcomponent entities render and fetch SOVD resources the same way as component entities, aligning UI behavior with how the gateway serves subcomponent resources (via the components API namespace).

Changes:

  • Map subcomponentcomponents for refresh and API entity-type routing.
  • Treat subcomponent as a component in EntityDetailPanel so the resource tab bar renders and resource counts/data are fetched.
  • Add a regression test ensuring subcomponents prefetch counts as components and render the full resource tab set.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/lib/store.ts Ensures Refresh re-fetches subcomponents using the components API type mapping.
src/components/EntityDetailPanel.tsx Enables resource fetching + tab rendering + header styling for subcomponent entities.
src/components/EntityDetailPanel.test.tsx Adds a regression test covering the subcomponent tab bar and counts prefetch behavior.

Comment on lines 629 to 633
case 'area':
return <Layers className="w-6 h-6 text-cyan-500" />;
case 'component':
case 'subcomponent':
return <Box className="w-6 h-6 text-indigo-500" />;
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.

Subcomponent entities render no resource tabs in detail panel

2 participants