feat: add Link block type (Closes #189)#233
Merged
Merged
Conversation
Renders titled or bare URLs as a single-line chip (↗ Title host) matching the Embed visual language. Title and URL share one storage slot (Title\nURL), with Tab to jump between fields, Ctrl+X to open the URL in the system browser, and a click in view mode to do the same. Long content scrolls horizontally so the chip never breaks layout. OSC 8 hyperlinks make the title clickable in supporting terminals. Also: - Esc in view mode now exits view mode before the quit prompt - Up/Down arrows on a Link skip its internal lines and navigate between blocks (use Tab to switch slots) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously fell through to the generic "any non-paragraph" branch, which kept the full "Title\nURL" content (or just "\n" when empty), producing a paragraph with a stray newline. Now keeps title (or URL when title is empty), matching how Definition/Code unwrap. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Up arrow on the topmost Link now inserts a paragraph above (matches the existing Heading/Code/etc. behavior so the user isn't trapped at the top of the document) - Enter at the very start of the title pushes the Link down by inserting a new paragraph above Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Linkblock type renders titled/bare URLs as a single-line chip (↗ Title host) — visual language matchesEmbedTitle\nURL; parser detects[title](url)and barehttps?://...on standalone lines; serializer round-tripsCtrl+Xopens URL in system browser (edit mode); click opens URL in view mode; OSC 8 hyperlinks for terminal-native click…so layout never breaks↗ Link titleplaceholder, matching Embed⌃X open · Tab urlshown when activeDrive-by: Esc in view mode now exits view mode first instead of jumping to the quit prompt.
Test plan
go vet ./...cleango build ./...cleango test ./...all packages pass/linkfrom palette → empty placeholder, no seededhttps://Ctrl+Xopens URL; click in view mode opens URL🤖 Generated with Claude Code