fix(tui): keep wrapped markdown links clickable

Closed
HA
5mo ago
+103-6872

Ported from anomalyco/opencode PR #21559.

Wires detectLinks into the non-experimental markdown code path so tree-sitter rendered URLs emit OSC 8 metadata instead of falling back to terminal auto-detection that breaks at line wraps.

Changes:

  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
  • packages/opencode/test/cli/tui/markdown-link-wrap.test.ts

Tests: 2/2 pass. Typecheck passes.


Summary by cubic

Keeps markdown URLs clickable when they wrap in the TUI. Emits OSC 8 links with detectLinks from @opentui/core instead of terminal auto-detection.

  • Bug Fixes

    • Apply onChunks={detectLinks} to non-experimental <code filetype="markdown"> in session view and reasoning content.
    • Add packages/opencode/test/cli/tui/markdown-link-wrap.test.ts to ensure one hyperlink id spans wrapped lines; defer Solid-level test due to Bun/Effect version mismatch.
  • Dependencies

    • Switch bun.lock to a symlink.

Summary by CodeRabbit

  • New Features

    • Enabled link detection in rendered markdown and code chunks, improving link recognition within session messages.
  • Tests

    • Added regression tests for markdown link wrapping to ensure URLs display correctly when wrapped across multiple terminal lines.