ENG-1831: Convert native tldraw arrows to discourse relations (Obsidian)#1118
ENG-1831: Convert native tldraw arrows to discourse relations (Obsidian)#1118trangdoan982 wants to merge 2 commits into
Conversation
…dian canvas. Persist to relations.json before swapping the shape so failed saves leave the native arrow unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
PR size/scope checkThis PR is over our review-size guideline.
Please split this into smaller PRs unless there is a clear reason the changes need to land together. If keeping it as one PR, please add a brief justification covering:
|
Also pass targetCanvasId on reifyRelation success toasts for consistency. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 117ecc79cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| startNode, | ||
| endNode, | ||
| relationTypeId, |
There was a problem hiding this comment.
Normalize reverse relations before persisting
When a native arrow is drawn in the reverse of an allowed schema edge (for example the default Claim → Evidence arrow for the Evidence supports Claim relation), getValidRelationTypesForNodePair still exposes that relation because it accepts reverse, and the converted shape is labeled with the complement, but this call persists startNode as the relation source and endNode as the destination. That writes relations.json as Claim supports Evidence instead of Evidence supports Claim, so the Relations panel shows the opposite label and publish code cannot match the schema triple for the saved relation. Swap the files/nodes when the selected relation is reverse-only before calling the persistence helper.
Useful? React with 👍 / 👎.
https://www.loom.com/share/df9f40b0fc2b43e1ac146f6e680f8ddc
Summary
discourse-relationshape (preserving geometry and bindings) and deleting the native arrow, matching the create-and-delete pattern used for text/image → node conversion.relations.jsonbefore the canvas swap so a failed save leaves the native arrow unchanged; shared persistence logic is extracted intopersistRelationBetweenNodeShapes.Test plan
relations.jsonentryMade with Cursor