-
Notifications
You must be signed in to change notification settings - Fork 7
ENG-2154 Undecorate Obsidian node titles into core_title on publish #1318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import type { DiscourseNodeInVault } from "./getDiscourseNodes"; | |
| import type { LocalConceptDataInput } from "@repo/database/inputTypes"; | ||
| import type { ObsidianDiscourseNodeData } from "./syncDgNodesToSupabase"; | ||
| import type { Json } from "@repo/database/dbTypes"; | ||
| import { extractContentFromTitle } from "./extractContentFromTitle"; | ||
|
|
||
| /** | ||
| * Get extra data (author, timestamps) from file metadata | ||
|
|
@@ -160,12 +161,17 @@ export const discourseRelationTripleSchemaToLocalConcept = ({ | |
| export const discourseNodeInstanceToLocalConcept = ( | ||
| context: SupabaseContext, | ||
| nodeData: ObsidianDiscourseNodeData, | ||
| nodeTypesById: Record<string, DiscourseNode>, | ||
| ): LocalConceptDataInput => { | ||
|
Comment on lines
161
to
165
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 New third argument added positionally instead of using named parameters as the repo style guide requires The node-type lookup map is passed as a third positional argument ( Style rule and sibling-function precedentAGENTS.md (TypeScript Guidelines): "Use named parameters (object destructuring) when a function has more than 2 parameters". Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| const extraData = getNodeExtraData(nodeData.file, context.userId); | ||
| const { nodeInstanceId, nodeTypeId, importedFromRid, ...otherData } = | ||
| nodeData.frontmatter; | ||
| const literal_content: Record<string, Json> = { | ||
| label: nodeData.file.basename, | ||
| core_title: extractContentFromTitle( | ||
| nodeTypesById[nodeData.nodeTypeId]?.format ?? "", | ||
| nodeData.file.basename, | ||
|
Comment on lines
+171
to
+173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For node formats containing regex metacharacters that the settings validator permits, this publishes an incorrect Useful? React with 👍 / 👎. |
||
| ), | ||
|
Comment on lines
+171
to
+174
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 New title-extraction behavior ships without any unit tests, contrary to repository rules The new derivation of the published title field is added ( Rule referenceAGENTS.md Testing section: "Write unit tests for new functionality" / "Ensure tests are meaningful and maintainable"; CONTRIBUTING.md step 4: "Write tests that validate your change and/or fix." The PR description acknowledges no tests were added because apps/obsidian lacks test infrastructure. Was this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+171
to
+174
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The write is unconditional on purpose: |
||
| source_data: otherData as unknown as Json, | ||
| }; | ||
| if (importedFromRid && typeof importedFromRid === "string") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The converter only had the type id, and the format lives on the type. The single caller already builds this map for
discourseRelationTripleSchemaToLocalConcept, so it comes in the same way.