Repository navigation
ENG-2258 Create a discourse relation from canvas and associate it with the selected node type pair - #1494
Merged
trangdoan982 merged 7 commits intoOct 2, 2026
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
trangdoan982
added this pull request to stack #1495
September 28, 2026 14:44
mdroidian
approved these changes
Sep 30, 2026
trangdoan982
force-pushed
the
eng-2258-create-a-discourse-relation-from-canvas-and-associate-it
branch
from
October 2, 2026 19:39
e360e20 to
2393336
Compare
…h the selected node type pair Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3M6B6ERYKXVX44A3Z6TZ8CR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3M6BDTS4G1NYZCH0QMDPXG8
… blank fields Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3M6VZS14XEE8NRP3SYVAH0K
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3M74W73JE6NCMK1E3EE6WPP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3M7620BA5K31EABR0WR01QD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3M7CXKYNM6GGRCNG14QVM0J
…open while saving Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3M7VZSCCEHXWPEKJX8709X7
trangdoan982
force-pushed
the
eng-2258-create-a-discourse-relation-from-canvas-and-associate-it
branch
from
October 2, 2026 20:56
2393336 to
6a2e3a4
Compare
trangdoan982
deleted the
eng-2258-create-a-discourse-relation-from-canvas-and-associate-it
branch
October 2, 2026 20:59
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://entire.io/gh/DiscourseGraphs/discourse-graph/trails/38
Reviewer brief
Stacked on DiscourseGraphs/discourse-graph#1492 (ENG-2257), which must merge first. This PR targets its branch.
Create newin the canvas relation menu opens an "Add relation type" dialog. Continue saves the type and links it to the arrow's node-type pair in one save. The menu then lists the new type, and "Relation type created" and "Discourse relation added" toasts appear.The diagram shows the path from
Create newto the refreshed menu.flowchart LR A["Create new<br/>RelationTypeDropdown.tsx"] --> B["CreateRelationTypeModal.tsx<br/>label / complement / color"] B --> C{"trimmed, required,<br/>getRelationTypeErrors"} C -- error --> B C -- ok --> D["createRelationTypeForNodePair<br/>relationTypeUtils.ts"] D --> E["push type + ENG-2257<br/>associateRelationTypeWithNodePair<br/>(one save)"] E -- save fails --> F["remove added type and relation by id<br/>dialog shows error"] E -- ok --> G["dialog closes, menu re-renders,<br/>2 toasts"]Modaloutside the dropdown's DOM. While it's open, the dropdown ignores its outside-click and Escape listeners. Otherwise a click or Escape in the dialog would dismiss the menu and delete the pending arrow (apps/obsidian/src/components/canvas/overlays/RelationTypeDropdown.tsx).showToastnow gives each toast a unique id. tldraw replaces a toast with the same id, and the old${severity}-${Date.now()}id collided when both success toasts fired in the same millisecond (apps/obsidian/src/components/canvas/utils/toastUtils.ts). This affects every canvas toast.getRelationTypeErrorsinapps/obsidian/src/utils/typeUtils.ts. Settings behaviour is unchanged: exact matching, no trimming.Verification
Driven in Obsidian 1.13.7 over CDP with real mouse and keyboard input, on the ENG-2256 fixture canvas. Run
2026-09-28T14-48-13, on the final build. The screenshots come from the identical first six rows of run2026-09-28T14-40-19. ENG-2257's five "Add existing" scenarios also pass on this build.data.jsonhas a local blue type with no status plus a Question → Claim triple.[supports, opposes, v2258 informs], both toastsLabel is required,Label is required,Complement is required,Duplicate label "supports",Duplicate complement "is supported by". Settings unchanged.Duplicate label "supports", and nothing is saved.Duplicate label "v2258 concurrent". The dialog stays open, and only one type has that label.saveSettingsslowed to 1.5s. Continue, then Escape and a backdrop click while saving.Screenshots:
Tests added:
apps/obsidian/src/utils/__tests__/typeUtils.test.ts:getRelationTypeErrors(duplicate label, duplicate complement, incomplete types skipped, exact matching).apps/obsidian/src/components/canvas/utils/__tests__/relationTypeUtils.test.ts:createRelationTypeForNodePair(type and triple saved once, rollback on failure, a type saved concurrently survives rollback).pnpm -C apps/obsidian test:unit.Not verified:
Loom video
https://www.loom.com/share/aa9df4db96844808b6ac51af3b986c6b
Scope check
$scope-checkagainst the ENG ticket and final diff.Done When: Dialog validation (required label and complement, no duplicate label or complement). The Settings duplicate check moved into a sharedgetRelationTypeErrorshelper that Settings and the dialog both use.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.Two passes, plus Devin's review. The first found that this branch was behind its base (ENG-2257's
c69f392c) and that the create helper's rollback restored a snapshot. Both are fixed: the branch is rebased, and rollback now removes only the added type by id. The second found that the dialog trimmed only for the required check. That is fixed too: the dialog trims before it validates and saves. Devin found that validation used the relation types captured when the dialog opened, and that Escape could close the dialog mid-save. Both are fixed ine360e20a.🤖 Generated with Claude Code