Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| template?: string; | ||
| templateTitle?: string; | ||
| format?: string; | ||
| color?: string; |
There was a problem hiding this comment.
color is the one field ENG-1986 adds to the CrossApp schemas. Marc-Antoine asked on ENG-2091 (2026-10-23, 2026-10-25) that every value CrossApp carries be an explicit field, and named format and colour. It is stored like format, at the top level of literal_content. Both apps already call this setting color.
| label: string; | ||
| complement: string; | ||
| // should we add colour? format? | ||
| color?: string; |
| author_local_id: node.authorId, | ||
| is_schema: true, | ||
| literal_content: { | ||
| literal_content: filterUndefined({ |
There was a problem hiding this comment.
filterUndefined keeps color out of literal_content when the relation type has none, as the node type converter above does for its optional keys. The test "leaves color out of literal_content when the relation type has none" in crossAppConverters.test.ts pins this.
| number | ||
| >; | ||
| const { template, template_content, roles, format, ...other } = | ||
| const { template, template_content, roles, format, color, ...other } = |
There was a problem hiding this comment.
Destructuring color moves it from metadata to the color field. Nothing in apps/ or packages/ reads metadata on a node type or relation type: the only consumer, Roam's importSharedRelations.ts, reads labels, the complement, the template and identity. No producer on main writes a top-level literal_content.color, so no current output changes.
| template: template_content as string | undefined, | ||
| templateTitle: template as string | undefined, | ||
| format: format as string | undefined, | ||
| color: color as string | undefined, |
There was a problem hiding this comment.
Reads only the top-level key. Obsidian rows published before #1633 keep their color in source_data.color, which stays in metadata. Nothing reads CrossApp color yet. The first reader (likely Roam import, TODO at importSharedRelations.ts:73) owns a fallback or backfill, as resolveSchemaFormat did for format.
| Note on metadata: It is read from the database, but currently not written. We will phase it out. | ||
|
|
||
| When some specific keys of `literal_content` are mapped to a CrossApp field, those key-value pairs are not included again in the `metadata`. Thus `metadata` is a grab-bag for residual data. (Eg color for now.) | ||
| When some specific keys of `literal_content` are mapped to a CrossApp field, those key-value pairs are not included again in the `metadata`. Thus `metadata` is a grab-bag for residual data. (Eg `source_data` for now.) |
There was a problem hiding this comment.
color is now a CrossApp field, so it is no longer residual. source_data is what metadata still carries for Obsidian rows.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer brief
ENG-1986 moves Obsidian sync off its own converters and onto the shared CrossApp converters, without loss of functionality. It ships as six PRs. PRs 1 to 4 and 6 are stacked on #1575 (ENG-1823). PR 5 targets
main:upsert_conceptstoday. No production change.colorbecomes a CrossApp field on node types and relation types, inpackages/database. It doesn't depend on PRs 1 to 4.colorthrough the shared converters. It needs PR 5, and its branch carries PR 5's change until that merges.Why six and not one: each step changes one kind of row, and #1620's tests show whether a stored value changed. PR 5 changes the shared contract, so it goes first in its own PR and needs its own review. Together the steps are well over the 400-line guideline.
coloris a CrossApp field on node types and relation types (CrossAppNodeSchema.color,CrossAppRelationTypeSchema.color).crossAppNodeSchemaToDbConceptandcrossAppRelationTypeSchemaToDbConceptwrite it toliteral_content.color.dbNodeSchemaToCrossAppanddbRelationTypeSchemaToCrossAppread it back and leave it out ofmetadata.mainalone no stored row and no converter output changes, because nothing setscolorand no row has a top-levelliteral_content.color. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (6/6) #1633's Obsidian sync is the first code that setscolor, and the first production caller ofcrossAppRelationTypeSchemaToDbConcept.colormoves out ofmetadataon the database-to-CrossApp side, and nothing inapps/orpackages/readsmetadataon a node type or relation type. The one consumer of those converters, Roam's shared-relation import (discoverSharedRelations.ts,importSharedRelations.ts), reads identity, labels, the complement and the template.formatis already a field.sourceDatais not in this PR.#7DA13E) and a relation type carries a tldraw color name (blue). The contract types both as a string, andconcept_design.mdsays which is which.crossAppRelationTypeSchemaToDbConceptnow buildsliteral_contentthroughfilterUndefined, as the node type converter does, so a relation type with no color sends nocolorkey.literal_content.source_data.color.dbNodeSchemaToCrossAppanddbRelationTypeSchemaToCrossAppread only the top-level key, as they do forformat, so they return nocolorfor such a row. Nothing reads CrossAppcoloryet, so a fallback here would be dead code. The first reader owns the fallback or a backfill, asresolveSchemaFormatdid forformat. The likely first reader is Roam's import (importSharedRelations.ts:73has the TODO). Obsidian import reads both places itself.nodeSchemaToCrossAppdoesn't setcolor, and Roam node types keep theirs incanvasSettings.color. No ticket covers the Roam converters yet.colorthere. The validators are also where a non-stringcolorin a row gets rejected: the converters here cast it, as they doformat.Verification
packages/database:vitest runpasses (152 tests) andtsc --noEmit --skipLibCheckpasses.turbo check-typesandturbo run test:unitpass with--force(Roam 716 tests, Obsidian 234 tests).eslint --max-warnings 0reports fiveno-unnecessary-type-assertionwarnings indbToCrossAppConverters.tsat lines 79 to 140. This PR's first change in that file is at line 171.packages/databasecucumber features, which need a database.Loom video
Not recorded yet.
Scope check
$scope-checkagainst ENG-1986 and the final diff.Done When: None.Done Whenasks that the cross-app schemas are complete, andcoloris the field the contract owner agreed to add.Standards check
$dg-pr-adherence-checkagainst the final diff and PR metadata.Local delegated full review
$dg-delegated-full-reviewwhen no other full-review workflow is available.