Skip to content

fix: render SOVD resources for nested entity types#73

Merged
bburda merged 1 commit into
mainfrom
fix/subcomponent-resource-tabs
May 17, 2026
Merged

fix: render SOVD resources for nested entity types#73
bburda merged 1 commit into
mainfrom
fix/subcomponent-resource-tabs

Conversation

@bburda
Copy link
Copy Markdown
Contributor

@bburda bburda commented May 3, 2026

Summary

Subcomponent and subarea entities (served through the components and areas API namespaces) expose the full SOVD resource set, but the UI only branched on type === 'component' / type === 'area'. Nested entities fell through to a bare header and the "No detailed information available for this entity." fallback, were filtered out of search, and rendered the wrong breadcrumb icon.

This change treats 'subcomponent' like 'component' and 'subarea' like 'area':

  • EntityDetailPanel: the resource-count prefetch and fetchEntityData, the tab bar / panel render branch, the header icon/background helpers, and the getEntityTypeForApi mapping.
  • Breadcrumb segments now resolve their entity type from the loaded tree (findNode) instead of position-based inference, so nested types and deeper hierarchies get the correct icon. getBreadcrumbIcon gains subcomponent / subarea cases.
  • SearchCommand: getEntityIcon / getEntityColorClass and the result grouping now include subcomponent / subarea, so they are findable.

Store-side refresh routing already maps both types through the shared NODE_TYPE_TO_RESOURCE map on main.


Issue


Type

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

Testing

  • EntityDetailPanel.test.tsx mounts the panel with selectedEntity.type === 'subcomponent' and 'subarea': the subcomponent renders the resource tab set and prefetches counts as components; the subarea renders the area panel and prefetches counts as areas. Both assert the "No detailed information available" fallback is absent.
  • Full suite: npm test (414 passed).
  • npm run lint and npm run typecheck are clean.
  • npm run build succeeds.

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

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 thread src/components/EntityDetailPanel.tsx
@bburda bburda self-assigned this May 15, 2026
@bburda bburda requested a review from mfaferek93 May 15, 2026 11:34
Copy link
Copy Markdown

@mfaferek93 mfaferek93 left a comment

Choose a reason for hiding this comment

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

A few comments

Comment thread src/components/EntityDetailPanel.tsx
Comment thread src/components/EntityDetailPanel.tsx
Comment thread src/components/EntityDetailPanel.tsx
Subcomponent and subarea entities are served via /api/v1/components/{id}
and /api/v1/areas/{id} and expose the full SOVD resource set, but the UI
only branched on type === 'component' / 'area'. Nested entities fell
through to a bare header and the "No detailed information available"
fallback, were filtered out of search, and got the wrong breadcrumb icon.

- EntityDetailPanel: treat 'subcomponent' like 'component' and 'subarea'
  like 'area' for resource fetching, tab/panel rendering, the API type
  mapping, and the header type-icon / background.
- Breadcrumb segments resolve their entity type from the loaded tree
  (findNode) instead of position-based inference, so nested types get the
  correct icon; getBreadcrumbIcon gains subcomponent / subarea cases.
- SearchCommand: index subcomponent / subarea with their own icon, color,
  and result group so they are findable.
- Regression tests cover the subcomponent tab bar and the subarea panel,
  asserting counts prefetch with the correct resource type.
@bburda bburda force-pushed the fix/subcomponent-resource-tabs branch from 9e5f28a to 8a40380 Compare May 17, 2026 17:04
@bburda bburda changed the title fix: render SOVD resources for subcomponent entity type fix: render SOVD resources for nested entity types May 17, 2026
@mfaferek93 mfaferek93 self-requested a review May 17, 2026 17:12
@bburda bburda merged commit 224c4e3 into main May 17, 2026
3 checks passed
@bburda bburda deleted the fix/subcomponent-resource-tabs branch May 17, 2026 17:13
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

3 participants