Skip to content

Commit 06aeae4

Browse files
authored
[ENG-1849] Persist Roam node type schema labels (#1131)
* [ENG-1847] Define shared cross-app node content contract * [ENG-1849] Add node-type schema dependency to cross-app node fixtures The cross-app node contract (ENG-1847) carries nodeType = { sourceLocalId, label } and the instance Concept references it via schema_represented_by_local_id, but the fixtures persisted no is_schema:true schema Concept for that id. Add the required schemaConcept (Roam Claim, Obsidian Evidence) carrying stable source identity + label only -- no source_data/format/color/tag, per the contract's "without redefining schema shape". Roam's existing 5-min sync already persists the schema Concept per contract (convertDgToSupabaseConcepts -> discourseNodeSchemaToLocalConcept; all types on initial sync, edited types incrementally via nodeTypeSince), so no Roam sync code change is needed for F4/F9/F13. Stacked on eng-1847 (PR #1129, unmerged). * [ENG-1849] Persist Roam schema labels
1 parent 9bb0b35 commit 06aeae4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/roam/src/utils/conceptConversion.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,21 @@ export const discourseNodeSchemaToLocalConcept = (
7878
node: DiscourseNode,
7979
): LocalConceptDataInput => {
8080
const titleParts = node.text.split("/");
81+
const label = titleParts[titleParts.length - 1] ?? node.text;
8182
const result: LocalConceptDataInput = {
8283
space_id: context.spaceId,
8384
name: node.text,
8485
source_local_id: node.type,
8586
is_schema: true,
87+
literal_content: {
88+
label,
89+
},
8690
/* eslint-enable @typescript-eslint/naming-convention */
8791
...getNodeExtraData(node.type),
8892
};
8993
if (node.template !== undefined)
9094
result.literal_content = {
91-
label: titleParts[titleParts.length - 1],
95+
label,
9296
template: templateToText(node.template),
9397
};
9498
return result;

0 commit comments

Comments
 (0)