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.
Summary
#76 fixed topic-data 400 errors in
runtime_onlymode by introducingresolveParentEntityType()insrc/lib/store.ts. The fix is correct; a few polish items remain.Proposed solution
resolveParentEntityTypeand add unit tests insrc/lib/store-helpers.test.tscovering theruntime_onlyfunction/app hierarchy (the scenario behind the original 400), following the existingparseTreePath/inferEntityTypeFromDepthtest pattern.NODE_TYPE_TO_RESOURCEandresolveParentEntityTypeabove the/** Fallback: fetch entity details from API when not in tree */comment so that comment again documentsfetchEntityFromApi.NODE_TYPE_TO_RESOURCE: "plural SOVD resources keyboard" -> "keywords".fetchEntityFromApi("...depth-based inference." / "which assumes...") into one sentence.NODE_TYPE_TO_RESOURCEwith the duplicate type maps (typeMapinrefreshSelectedEntity, the${parentType}sconstruction in the topic handler).Additional context
Follow-up to #76. All items are in
src/lib/store.ts.