Skip to content

[ENG-1547] Relation creation via drag handle (Obsidian)#909

Open
trangdoan982 wants to merge 10 commits intomainfrom
eng-1547-implement-relation-creation-via-drag-handles-in-tldraw
Open

[ENG-1547] Relation creation via drag handle (Obsidian)#909
trangdoan982 wants to merge 10 commits intomainfrom
eng-1547-implement-relation-creation-via-drag-handles-in-tldraw

Conversation

@trangdoan982
Copy link
Copy Markdown
Member

@trangdoan982 trangdoan982 commented Mar 23, 2026

https://www.loom.com/share/ee0d603ff9db4025a1c8f857f2b01aec

Summary

  • Clicking an existing persisted relation arrow now shows the relation type dropdown at the arrow midpoint
  • Selecting a new type updates the arrow visuals (color, label) and persists the change to relations.json in-place (preserving id, created, author, etc.)
  • Added updateRelationType() helper to relationsStore.ts
  • Handles edge cases: same-type re-selection dismisses without changes, Escape/click-outside closes without modifying, dropdown doesn't re-open after creation or edit flows

Test plan

  • Create a relation via drag handles — existing flow still works, dropdown closes after selection
  • Select a new type — arrow updates (color, label) and relations.json type field updated in-place
  • Escape/click outside — dropdown closes, arrow disappear
  • Relation Overlay updated correctly after relation is created
image

🤖 Generated with Claude Code


Open with Devin

@linear
Copy link
Copy Markdown

linear bot commented Mar 23, 2026

@supabase
Copy link
Copy Markdown

supabase bot commented Mar 23, 2026

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

devin-ai-integration[bot]

This comment was marked as resolved.

@trangdoan982 trangdoan982 force-pushed the eng-1547-implement-relation-creation-via-drag-handles-in-tldraw branch from 75c8668 to 0ebe9ce Compare March 26, 2026 03:47
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

graphite-app[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@trangdoan982 trangdoan982 changed the title [ENG-1547] Add relation type editing via click on existing arrows [ENG-1547] Relation creation via drag handle (Obsidian) Mar 27, 2026
@trangdoan982 trangdoan982 requested a review from mdroidian March 27, 2026 19:43
Copy link
Copy Markdown
Member

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. CI is failing.

  2. This PR is ~50% over the line change limit. I understand this might be required (or ideal) in this case, that being said, would you mind creating a Loom video walking through this code and code choices?

The biggest concern I have doing a quick review was the code possibly not being as DRY as possible. I worry we might be duplicating work, specifically in the relation/arrow drag handling logic and potential relations checking.

devin-ai-integration[bot]

This comment was marked as resolved.

@trangdoan982 trangdoan982 requested a review from mdroidian April 6, 2026 17:05
@trangdoan982
Copy link
Copy Markdown
Member Author

@mdroidian video explain file structure here: https://youtu.be/BBAKm1G-zXM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants