feat(whats-new): render standalone release-note links as clickable

The What's New / release-notes modal renders the GitHub release body through a
custom block model that stripped inline markup and had no link support, so a
markdown link showed as literal `[text](url)`. Now:
- inline links `[text](url)` collapse to just their text (clean attributions),
- a whole-line link becomes a KIND_LINK block rendered as a clickable accent
  link opened in the browser (a new WhatsNewActions.open-url reusing open::that,
  mirroring about.rs).

Adds a `url` field to WhatsNewBlock plus a small markdown-link parser. The 2.0.2
notes use it for the daemon-wiki link. Built + smoked at release (window ready,
ALSA 192kHz bit-perfect, playback OK).

cc
This commit is contained in:
vicrodh committed 2026-07-20 21:43:02 -06:00
1 parent f9713591fe
commit b4b1f38cf0
3 files changed
+114 -4

No files matched your search

+22 -1
View File
@@ -177,7 +177,8 @@ export component WhatsNewModal inherits Rectangle {
font-size: block.level >= 2 ? 11px : 12px;
}
Text {
// Section / bullet / paragraph text (kinds 0-2).
if block.kind != 3: Text {
text: block.text;
horizontal-stretch: 1;
wrap: word-wrap;
@@ -195,6 +196,26 @@ export component WhatsNewModal inherits Rectangle {
? Typography.bold
: Typography.regular;
}
// Whole-line link (kind 3) — a clickable accent link.
if block.kind == 3: Rectangle {
horizontal-stretch: 1;
height: link-text.preferred-height;
link-text := Text {
text: block.text;
width: 100%;
wrap: word-wrap;
color: link-ta.has-hover ? Theme.accent-hover : Theme.accent;
font-size: 13px;
font-weight: Typography.medium;
}
link-ta := TouchArea {
mouse-cursor: pointer;
clicked => {
WhatsNewActions.open-url(block.url);
}
}
}
}
Rectangle { height: 8px; }
+3
View File
@@ -5915,6 +5915,7 @@ export struct WhatsNewBlock {
level: int,
text: string,
id: string,
url: string,
}
// One table-of-contents entry (level-0 section headings only).
@@ -5937,4 +5938,6 @@ export global WhatsNewActions {
// Open the modal AND kick off the GitHub release fetch (Rust).
callback open();
callback close();
// Open an external URL from a standalone release-notes link (Rust: open::that).
callback open-url(string);
}