Skip to content

feat: add Link block type (Closes #189)#233

Merged
oobagi merged 3 commits into
mainfrom
feat/issue-189-bookmark-block
Apr 26, 2026
Merged

feat: add Link block type (Closes #189)#233
oobagi merged 3 commits into
mainfrom
feat/issue-189-bookmark-block

Conversation

@oobagi
Copy link
Copy Markdown
Owner

@oobagi oobagi commented Apr 26, 2026

Summary

  • New Link block type renders titled/bare URLs as a single-line chip (↗ Title host) — visual language matches Embed
  • Storage: Title\nURL; parser detects [title](url) and bare https?://... on standalone lines; serializer round-trips
  • Tab / Shift+Tab jumps between title and URL slots; Up/Down navigate to prev/next block (don't swap fields)
  • Ctrl+X opens URL in system browser (edit mode); click opens URL in view mode; OSC 8 hyperlinks for terminal-native click
  • Long titles/URLs scroll horizontally with cursor-follow; inactive truncates with so layout never breaks
  • Empty Link renders ↗ Link title placeholder, matching Embed
  • Status hint ⌃X open · Tab url shown when active

Drive-by: Esc in view mode now exits view mode first instead of jumping to the quit prompt.

Test plan

  • go vet ./... clean
  • go build ./... clean
  • go test ./... all packages pass
  • Manual: /link from palette → empty placeholder, no seeded https://
  • Manual: type long title/URL → no layout break, cursor stays visible
  • Manual: Ctrl+X opens URL; click in view mode opens URL
  • Manual: Tab jumps slots; ↑/↓ navigates blocks; Esc exits view mode

🤖 Generated with Claude Code

oobagi and others added 3 commits April 25, 2026 18:01
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>
@oobagi oobagi merged commit ddd6748 into main Apr 26, 2026
1 check passed
@oobagi oobagi deleted the feat/issue-189-bookmark-block branch May 5, 2026 15:08
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.

1 participant