Repository navigation
Studio: make links in the collapsed update notes clickable - #16829
Conversation
…s are added (#16856) ## Summary From 21:00 UTC yesterday until #16809 merged, `Frontend unit tests (Windows)` and `Frontend build + bundle sanity` failed on every frontend PR (#16826, #16829, #16831, #16839, #16854 and others) with the same test: ``` not ok 4712 - family options follow the backend registry, deduplicated, and every backend family has a label location: 'studio/frontend/tests/family-override.test.ts:54:1' + [ [ 'chroma', 'chroma' ], [ 'anima', 'anima' ] ] - [] ``` #16710 added the `chroma` and `anima` image families to the backend registry. That part is fine, and #16809 added the missing picker labels. The test caught it correctly, but on the wrong PR: it reads `diffusion_families.py` and `video_families.py`, yet only Frontend CI runs it, and Frontend CI only triggers on `studio/frontend/**`. So the backend-only PR that added the families never ran it and merged green, and the next frontend PR inherited the failure. ## Change `studio/backend/tests/test_family_override_labels.py`, a new test only. It takes every family name from `diffusion_families._FAMILIES` and `video_families._FAMILIES`, reads the keys of `LABELS` in `family-override.ts`, and fails if a family has no label, naming the missing ones. Backend CI triggers on `studio/**`, so the PR that adds a family now has to add its label too. A second small test pins the `LABELS` parser on quoted (`"flux.1":`) and bare (`sdxl:`) keys, so a reformatted table cannot quietly read as empty. Running Frontend CI on every family registry change would also work, but those files change many times a day and the frontend jobs include Windows and macOS legs. One backend test costs under a second. No product code changes, and the frontend test stays as it is. ## Testing - On main (with #16809): 2 passed. - Deleting `chroma: "Chroma"` from `LABELS` again: fails with `add these families to LABELS in family-override.ts: ['chroma']`. - The file sorts into the existing `a-f` backend shard by glob. `tests/test_ci_backend_pytest_shards.py`: 26 passed.
The collapsed card found each link by searching for its label, so a [here] link after the word everywhere underlined the middle of everywhere and left the real link plain. The preview now records where each link sits in the plain text and the card slices at those offsets; links cut by truncation or the lead/rest split stay plain, and the summary text is unchanged. [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79157e80dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!href) { | ||
| return label; | ||
| } | ||
| hrefs?.push(href); |
There was a problem hiding this comment.
Decode character references before storing link destinations
For a valid Markdown link such as [Guide](https://example.com/?a=1&b=2), this stores the destination verbatim. The later entity-decoding pass only processes the remaining text, so the collapsed anchor receives & literally and sends an amp;b query parameter instead of b. Numeric references in paths similarly produce incorrect URLs. Decode destination character references before storing the href so collapsed links navigate to the same destination as the expanded Markdown.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in abb4e19: destinations decode character references (CommonMark 2.5) before they become the href; test added.
| } else if (piece === LINK_CLOSE) { | ||
| const shown = (label ?? "").replace(WHITESPACE, " ").trim(); | ||
| const end = text.trimEnd().length; | ||
| const href = hrefs[opened - 1]; |
There was a problem hiding this comment.
Keep destinations aligned when cleanup removes link markers
When later cleanup removes an earlier candidate's markers, counting surviving opening markers no longer indexes the corresponding href. For example, - <span title="[hidden](https://a.test)">Model</span> [Guide](https://b.test) produces a visible Guide link pointing to https://a.test: stripHtmlTags() removes the first marker pair but leaves its destination in hrefs. The plain-text equality check still succeeds, so it does not catch the wrong destination. Associate each marker with a stable destination ID, or remove hidden candidates before recording their hrefs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in abb4e19: each link's open and close marks carry its href index and must match, so a stripped pair cannot shift later links; test added.
…notes A destination like ?a=1&b=2 kept the literal entity, and a link hidden inside a stripped HTML attribute left its href behind, shifting every later link onto the wrong destination. Destinations now decode character references as CommonMark does, and each link's open and close marks carry its href index. [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abb4e19790
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const IMAGE_REFERENCE = new RegExp(`!\\[${LABEL}\\](?:\\[([^\\]]*)\\])?`, "g"); | ||
| const LINK_REFERENCE = new RegExp(`\\[${LABEL}\\](?:\\[([^\\]]*)\\])?`, "g"); | ||
| // A parked escape or code span in the destination keeps the link plain. | ||
| const WEB_DESTINATION = /^\((https?:\/\/[^\s()<>\uE000-\uE003]+)\)$/i; |
There was a problem hiding this comment.
Encode literal backslashes in clickable link destinations
With a valid destination such as [Guide](https://example.com/docs\alpha.md), the backslash before a is literal under CommonMark, but this pattern accepts it and the href is subsequently stored without URI normalization. A browser normalizes that href to https://example.com/docs/alpha.md, whereas the expanded Markdown renderer preserves the character as %5C, so clicking the collapsed summary can open a different resource or return a 404. Encode literal backslashes before storing the href, or exclude them from this conservative clickable subset.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the latest push: a destination containing a backslash, raw or as a decoded character reference, now stays plain text; tests added.
Browsers read a backslash in an http(s) path as a slash while the expanded notes percent-encode it, so the two views would open different pages. The check runs on the decoded destination, so \ is caught too. [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19a22401eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const source: Bullet[] = | ||
| topLevel.length > 0 | ||
| ? topLevel | ||
| : prose.map((text) => ({ text, indent: 0, links: [] })); |
There was a problem hiding this comment.
Preserve links when the preview falls back to prose
For releases written as paragraphs rather than bullets, takeText() discards the link spans it computes, and this fallback gives every preview item links: []. This affects an existing release format: the announcement in tests/studio/fixtures/release_bodies/v0.1.60-beta.md contains “Run Muse Glimmer” and “Fine-tune Muse Glimmer” links, but both remain unclickable in the collapsed card. Carry the spans through prose collection and truncation so ordinary HTTP(S) links work in this supported summary path too.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the latest push: paragraphs carry link spans through joining and truncation, so the prose fallback renders its http(s) links; test added. (The v0.1.60-beta fixture itself previews its bullets, so its intro links are not in the collapsed card either way.)
Releases written as paragraphs preview their prose, which dropped every link. Paragraphs now carry link spans through joining and truncation like bullets, with the bullet path sharing the same clip and append helpers.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cc9e68fb2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (end <= lead.length) { | ||
| parts.push({ part: "lead", start, end, href }); | ||
| } else if (start >= restStart) { |
There was a problem hiding this comment.
Preserve links that cross the lead-sentence boundary
For a link such as - [Faster inference. Read the guide](https://example.com/guide), splitLeadSentence() splits the label between lead and rest. Its span then fails both conditions here, so the collapsed card renders the entire, untruncated label without an anchor. Split crossing spans into two spans with the same href, or avoid cutting through a span, so an ordinary HTTP(S) link does not lose clickability solely because its label contains a sentence break.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the latest push: a span the lead split cuts through becomes one anchor in the lead and one in the rest, same href; test added.
A link whose label held a sentence break was dropped because its span fit neither the lead nor the rest; it now becomes one anchor on each side. [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The update card in the bottom right corner shows a short summary of the release notes before they are expanded. That summary turned every markdown link into plain text, so a note like "Dynamic V3.1 - 10-15% extra accuracy Guide" showed "Guide" with nothing to click. The link only worked after opening the full release notes.
Links to http and https pages in the summary now render as underlined links that open in a new tab, the same way they look in the expanded notes. Other link types, images and code stay plain text as before, and the summary text itself does not change.
Each link's position is recorded while the notes are reduced to plain text, and the card slices the summary at those offsets. Earlier revisions searched the summary for the link's words, so a
[here](...)link after "everywhere" underlined the middle of "everywhere". Link destinations decode character references as CommonMark does (&becomes&). Destinations with a backslash stay plain, since browsers read it as/while the expanded notes encode it. Links in paragraph-only notes and links whose label spans the lead sentence break are kept as well. The summary text is byte-identical to main on the last 60 release bodies plus 20,000 generated documents.Collapsed card with the same offer and notes on main (left) and this branch (right), Chromium; Firefox and WebKit produce the same 0 and 5 anchors: