Repository navigation
fix(tui): give links their own hue and make preview links clickable - #714
Merged
Merged
Conversation
Two link defects in the content pane. The Markdown preview rendered through `render_markdown`, which strips destinations but keeps the underline, so a link in a previewed file was underlined on every terminal and clickable on none: no destination ever reached the cells. Build the preview through `render_markdown_links` and mark its rows in the same paint-then-mark order and under the same per-frame gate the transcript uses. Links also rendered as `text_primary` plus underline, which is exactly what the footer's focused chips look like. Add a `link` palette token (falls back to `info`) and paint link labels with it, so the hue separates a link from every other underlined run while the underline keeps the affordance on terminals that cannot carry colour.
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.
What
Two link defects in the content pane.
Preview links were underlined but unclickable. The Editor tab's Markdown preview rendered through
render_markdown, which strips destinations but keepslink_label_style's underline. No destination ever reached the buffer cells, so the link could not be acted on in any terminal.Links looked like any other underlined run. Link labels rendered as
text_primaryplus underline — exactly what the footer's focusedllm/effortchips look like.Follow-up to #712, which made bare URLs carry destinations in the transcript.
How
set_markdown_previewbuilds its rows withrender_markdown_links(same geometry, destinations kept), andpaint_preview_rowmarks the columns after painting, under a single per-framehyperlinks_enabled()gate — the same paint-then-mark order and the same gateconversation::paint_rowalready uses.linktoken inThemePalette, optional in theme files and falling back toinfo(the neutral-information hue, deliberately outside the accent/status hue invariant) so existing theme drops keep parsing. Forge Dark#4FC9DF, Forge Light#00606E, both AA-checked on canvas/panel/panel_alt.links::link_label_stylepaints the label with that hue and keeps the underline, so the hue separates a link from every other underlined run while the underline keeps the affordance on terminals that cannot carry colour (§5.4).accentstays out of the label: it means focus, and the footer already underlines its focused chips in it.FORGE-DESIGN.md:linkrow in the §5 token table, a §6 rule ("an underline on its own never says link") plus a hierarchy row, and the §9 "underline is a promise" bullet rewritten around the hue.Out of scope on purpose
Test plan
cargo test -p forge-config --locked— 100 passed.cargo test -p forge-tui --locked link32,markdown69,theme::48,source_viewer61,user_message_gutter32 — all green.hyperlinks_enabled()says the terminal renders them;links::tests::a_link_is_not_just_an_underlined_runpins that a link label is neither primary text nor accent.cargo fmt --all -- --checkclean;cargo clippy -p forge-tui -p forge-config --all-targets --locked -- -D warningsclean.cargo build --release --locked --package forge-cli, open a Markdown file,:preview, then ⌘-click (macOS) / ctrl+click (Linux) in Ghostty.