Skip to content

Commit e8a0530

Browse files
committed
fix: skip resource prefetch for Area entities
Areas in ros2_medkit are pure namespace groupings without their own data/operations/configurations/faults collections. The gateway returns 404 on /areas/{id}/data etc., which surfaced as noisy errors whenever an Area was selected in the entity tree. Skip the prefetch entirely for Areas so entity selection stays silent.
1 parent 847c8af commit e8a0530

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/components/EntityDetailPanel.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,20 +403,19 @@ export function EntityDetailPanel({ onConnectClick, viewMode = 'entity', onEntit
403403
const entityId = selectedEntity.id;
404404
const isComponent = selectedEntity.type === 'component';
405405
const isApp = selectedEntity.type === 'app';
406-
const isArea = selectedEntity.type === 'area';
407406
const isFunction = selectedEntity.type === 'function';
408407

409-
// Only fetch counts for entity types that have resources
410-
if (!isComponent && !isApp && !isArea && !isFunction) {
408+
// Areas are pure groupings in ros2_medkit and the gateway returns 404
409+
// on /areas/{id}/data etc. Skip resource prefetch for them to avoid
410+
// surfacing spurious errors on entity selection.
411+
if (!isComponent && !isApp && !isFunction) {
411412
setResourceCounts({ data: 0, operations: 0, configurations: 0, faults: 0 });
412413
setTopicsData([]);
413414
return;
414415
}
415416

416-
// Determine entity type for API calls
417417
let entityType: SovdResourceEntityType = 'components';
418418
if (isApp) entityType = 'apps';
419-
else if (isArea) entityType = 'areas';
420419
else if (isFunction) entityType = 'functions';
421420

422421
try {

0 commit comments

Comments
 (0)