Skip to content

Polish follow-up: regression test + comment cleanup for parent entity-type resolution #77

Description

@bburda

Summary

#76 fixed topic-data 400 errors in runtime_only mode by introducing resolveParentEntityType() in src/lib/store.ts. The fix is correct; a few polish items remain.


Proposed solution

  • Export resolveParentEntityType and add unit tests in src/lib/store-helpers.test.ts covering the runtime_only function/app hierarchy (the scenario behind the original 400), following the existing parseTreePath / inferEntityTypeFromDepth test pattern.
  • Move NODE_TYPE_TO_RESOURCE and resolveParentEntityType above the /** Fallback: fetch entity details from API when not in tree */ comment so that comment again documents fetchEntityFromApi.
  • Fix JSDoc typo in NODE_TYPE_TO_RESOURCE: "plural SOVD resources keyboard" -> "keywords".
  • Remove the blank line between the two new JSDoc blocks and their declarations so they register as doc comments.
  • Merge the split comment fragment in fetchEntityFromApi ("...depth-based inference." / "which assumes...") into one sentence.
  • Optional: consolidate NODE_TYPE_TO_RESOURCE with the duplicate type maps (typeMap in refreshSelectedEntity, the ${parentType}s construction in the topic handler).

Additional context

Follow-up to #76. All items are in src/lib/store.ts.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions