Repository navigation
ENG-2228 Add link support to tldraw text shapes in Obsidian (prototype C: reuse tldraw's link button) - #1504
Merged
trangdoan982 merged 2 commits intoOct 9, 2026
Conversation
Not for merge -- a comparison branch against 5253da0, which ships a two-line eligibility patch and keeps a vendored hyperlink button. Patches @tldraw/validate so linkUrl accepts obsidian://open?file=, editing the check body rather than the protocol Set so advanced-uri's commandid stays rejected. Patches tldraw to export HyperlinkButton, dispatch a cancelable tldraw.navigate-link event from it, and keep non-web URIs out of href. One listener in the app then serves every link button tldraw renders, so geo, note and image shapes get the same in-app open and cross-vault check as text. App code drops 477 -> 434 lines: the vendored button and our own allowlist go, and the dialog's text-vs-geo validator split collapses. Patch surface grows 26 -> 241 lines across two packages, and becomes a behaviour patch on a shared component rather than a predicate flip. Verified over CDP: the five text-link scenarios still pass, and a geo shape now accepts an obsidian page link, omits href, and opens it in the sidebar. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Entire-Checkpoint: 01M3WAA741724YSM5FFQ91Q97J
Validation was unified across shape types but the hint still told geo shapes "Enter a URL." Also drops the unused T import and the never-narrowed isValid call that tripped two lint warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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
|
3 tasks done
trangdoan982
merged commit Oct 9, 2026
e197200
into
eng-2228-add-link-support-to-tldraw-text-shapes-in-obsidian
9 checks passed
Member
Author
|
This approach was chosen and now lives in #1442; its commits merged into that PR's branch, not |
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.
Reviewer brief
Result: The same text-shape links as #1442, but
obsidian://open?file=…page links also work on geo, note, image, video and bookmark shapes, and the link icon is tldraw's ownHyperlinkButtoninstead of our vendored copy.How it differs from #1442:
tldraw@3.14.2.patch: eligibility gate only (26 lines)HyperlinkButton+ cancelabletldraw.navigate-linkevent (201 lines), and@tldraw__validate@3.14.2.patchwideninglinkUrl(40 lines)T.linkUrlfor the restT.linkUrleverywhere (patched)TextLinkOverlayutils/linkNavigation.ts, serving every link buttonReview focus:
Set. Addingobsidian:tovalidLinkProtocolswould also admit action URIs such asadvanced-uri?commandid=; onlyobsidian://openwith afileparam passes.MakeUrlsValidmigrations that silently blank any URLT.linkUrlrejects. Dropping the validator patch later would wipe savedobsidian://links on those shapes at load.TextLinkDialogfork stays: tldraw'sEditLinkDialogwritesprops.url, and text links live inmeta.url.Verification
Driven in a real vault over CDP at
52dd9c91: #1442's five text-link scenarios still pass, and a geo shape accepts anobsidian://openpage link, renders the button without anhref, and opens the page in the sidebar.5cbaa2beonly changes the dialog's hint copy and lint fixes; on that headcheck-typesandlintare clean (0 warnings) andpnpm buildhas 0 errors.Not verified: note, image, video and bookmark shapes were not driven; they share the geo path (same validator, same button, same listener) but no scenario covers them.
Scope check
$scope-checkagainst the ENG ticket and final diff.Done When: page links on non-text shapes and two tldraw patches. Exploratory, in response to @mdroidian's review on ENG-2228 Add link support to tldraw text shapes in Obsidian #1442 asking whether tldraw's own link button and dialog could be reused via a patch.Standards check
$dg-pr-adherence-checkagainst the final diff and PR metadata.Not run — prototype.
Local delegated full review
Not run — prototype.
🤖 Generated with Claude Code