Repository navigation
Show the version a page was introduced in as a badge in the sticky header - #452
Conversation
✅ Deploy Preview for docs-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Feediver1
left a comment
There was a problem hiding this comment.
Summary
Small, clean change. It adds the badge in the right place, it reuses the existing .status-badge and tippy setup, and when the attribute isn't set nothing renders. I found no blocking bugs. Most of the suggestions are about the planned follow-up, where Connect removes the "Introduced in version" sentence from the page body. That step should wait until a couple of design gaps are closed.
What it does
src/partials/article.hbs: when the page sets:page-introduced-in:, the sticky header shows astatus-badge--sincepill with the text "Since X" and the tooltip "Introduced in version X." It sits after the Beta, Preview and LA badges and before the ADP and availability badges.src/css/doc.css: adds light and dark styles for the neutral badge.preview-src/: adds a test page and a nav entry.
Verification
- Attribute name: the template reads
page.attributes.introduced-in, which is:page-introduced-in:in AsciiDoc. No page indocs,cloud-docsorrp-connect-docssets it today (I greppedorigin/mainin each). That's expected, because the generator change is still open (connectdocs/introduced-in-attribute). For nowrp-connect-docshas 81 pages that carry the literal sentenceIntroduced in version X.insideifndef::env-cloud[]. - When the attribute is absent: the
{{#if}}guard means no markup renders. The deploy preview confirms this:introduced-in-test.htmlrenders<span class="status-badge status-badge--since" data-tippy-content="Introduced in version 4.43.0.">Since 4.43.0</span>, and the LA control page has no--sincebadge. - Preview page: the bundle is built from
src/only, andpreview-srcis used just by the preview and lint tasks. The test page doesn't ship. - Contrast: light mode is #374151 on #f3f4f6, about 9:1. Dark mode uses the same #cbd5e1 on translucent slate as the existing Preview dark badge. Both pass WCAG AA.
- I couldn't run a local
preview:buildbecause my clone'snode_modulesdoesn't haveprismjs, so I checked against the Netlify deploy preview.
Blocking issues
None.
Suggestions
- Make the template hide the badge on Cloud. The comment says only self-managed pages set the attribute, but nothing enforces that. Cloud pages pull Connect component pages in with
include::connect:components:…[tag=single-source]. Attribute entries inside an included body still end up in the document's attributes, so if the generator ever writes:page-introduced-in:inside thesingle-sourcetag (or outside anifndef::env-cloud[]), Cloud will show a Connect version that doesn't apply to it. Cloud already setspage-cloud: true, and line 5 already uses that flag forlatest-banner. One more condition closes the gap: - Keep the version in the page body as well as the header. Merging this first, then DEM and connect, so that connect drops the body sentence means the version only exists in
article.hbschrome. The Markdown export (markdown-dropdown), Kapa/LLM ingestion and anything else that readspage.contentsthen lose it, and "which version added sap_hana?" stops having a source. Either keep the body sentence, or check that the Markdown/LLM pipeline emitspage-introduced-in(for example as front matter) before connect removes it. - Badge text (UX review). "Since 4.43.0" passes the label bar: a short noun phrase, a numeral, no punctuation. Two gaps:
- The tooltip doesn't say which product the number belongs to. On Connect pages the badge sits next to the version selector, which uses a different scheme (for example, 26.x for Redpanda). Suggested tooltip: "Introduced in Redpanda Connect 4.43.0." Since this partial is shared across components, an optional
:page-introduced-in-product:attribute could supply the name, with the current text as the fallback. - The tooltip mostly repeats the label. Naming the product fixes that too, because the tooltip then adds a new fact.
- The tooltip doesn't say which product the number belongs to. On Connect pages the badge sits next to the version selector, which uses a different scheme (for example, 26.x for Redpanda). Suggested tooltip: "Introduced in Redpanda Connect 4.43.0." Since this partial is shared across components, an optional
- Accessibility. The badge is a non-focusable
<span>, so keyboard users can't open the tooltip, and screen readers only announce "Since 4.43.0". The other badges have the same issue, so this isn't a regression. If you take suggestion 3, anaria-labelwith the full tooltip text (or the visible text "Since Connect 4.43.0") gives assistive tech the context. - Normalize or document the value format. The value goes in as-is, so
v4.43.0renders as "Since v4.43.0", and a trailing period produces "4.43.0.." in the tooltip. Either note in the comment that the value is a bareX.Y.Z, or strip a leadingvin a helper. - Consider a cutoff for old versions. The generator will set the attribute on every connector, including ones from 3.x and 4.0. A permanent "Since 3.36.0" pill tells readers very little and adds width to a header that already wraps at 1024px or less. The generator could skip versions older than N releases.
- Small cleanups:
- The dark rule nearly duplicates
html[data-theme="dark"] .status-badge--preview(0.1/0.25 vs 0.15/0.3 alpha). Sharing a selector would stop them drifting apart. - Update the comments that list the badges:
doc.css"Status badges (Beta, Limited Availability)" andarticle.hbs:27"Beta, Preview, Limited Availability". - The test page could also cover the badge together with
:page-beta:or:page-limited-availability:, and an empty:page-introduced-in:, to check the layout when several badges show.
- The dark rule nearly duplicates
- Unrelated diff locally: compared with
origin/main, my checkout of the branch also shows.github/CODEOWNERSandblobl-editor/wasm/go.*changes. GitHub's file list shows only the 4 intended files, so this is probably a stale base. Worth a rebase before merge to be sure.
What works well
- Minimal footprint: it reuses
.status-badge, the[data-tippy-content]help cursor and the existing tooltip setup, with no new JS. white-space: nowrapfrom the base class keeps the pill on one line, and the existing sticky-headerflex-wraphandles narrow widths.- The dark-mode colors match the existing neutral (Preview) badge palette.
- The merge order in the description (UI first, then content) avoids a gap where pages have lost the sentence but have no badge yet.
- The preview page and its control are easy to check.
…version The badge now never renders on Cloud pages, even if a single-sourced page carries page-introduced-in. An optional page-introduced-in-product attribute names the product in the tooltip (Introduced in Redpanda Connect 4.43.0.), with "version" as the fallback. A new normalize-version helper strips a leading v and trailing periods. Screen readers get the full tooltip text instead of only "Since X". The dark style now shares the Preview badge rule, and the badge comments list every badge. Adds template tests run in CI, plus preview pages for the badge next to Beta and Limited Availability and on a Cloud page.
|
@Feediver1 thanks. Changes are in d48ffd9 (main merged in first, at da3013d).
Checked on the deploy preview in Chrome: tooltip text, badge order, dark colors, no badge on the Cloud or LA pages, no horizontal scroll at 600px. The tests pass on Node 18, and 5 of the 7 fail against the previous template. |
Feediver1
left a comment
There was a problem hiding this comment.
Re-review: Show the version a page was introduced in as a badge in the sticky header
Reviewed at head d48ffd96. Last review was at 0662dbb7.
Verdict: ✅ No blockers. Ready for approval.
Suggestions from the last review
- Hide the badge on Cloud: fixed. The badge is now gated on
(and page.attributes.introduced-in (not page.attributes.cloud)), andintroduced-in-cloud-test.htmlsets both attributes and shows no badge. - Keep the version outside the header: covered. docs-extensions-and-macros#394 (merged 10/24) adds
page-introduced-into the Markdown front matter. The description's merge order still has connect dropping the body sentence last. - Name the product: fixed. The new optional
:page-introduced-in-product:gives "Introduced in Redpanda Connect 4.43.0.", and the fallback is "Introduced in version 4.43.0." Setting it in rp-connect-docsantora.ymlis a follow-up. - Accessibility: fixed for screen readers. The visible "Since X" is
aria-hidden, and a visually hidden span carries the full text. Keyboard focus for every badge is deferred, which is reasonable because it affects all of them. - Value format: fixed.
normalize-versiontrims whitespace, drops a leadingv(only before a digit) and trailing periods, and returns''for no value or an object. A value that's empty after normalizing renders nothing, because{{#with ''}}skips its block. - Cutoff for old versions: deferred to the generator (connect#4968). Agreed, since the template can't know what counts as old.
- Cleanups: done. The dark rule shares the Preview selector, both badge comments list every badge, and the combo preview page shows Beta, LA and Since together.
- Stale base: main is merged in.
What I verified
- Read the diff
0662dbb7...d48ffd96, ignoring the main merge. - Checked that the
and,notand newnormalize-versionhelpers exist insrc/helpers/. Handlebars escapes the product name and the version in both the tooltip and the screen-reader text. - Ran
tests/introduced-in-badgelocally on Node 22: 7/7 pass. All CI checks pass, and the branch merges cleanly.
Nit
- The screen-reader text drops the tooltip's trailing period ("Introduced in version 4.43.0" vs "…4.43.0."). That's harmless, but the two strings are built separately, so they could drift. A small inline partial would keep them the same.
The screen reader text dropped the tooltip's trailing period. Both now render the same inline partial, and the tests assert they match.
|
@Feediver1 Fixed in 5fcf35d. The tooltip and the screen reader text now come from one inline partial, so both end with the period. The tests assert the two strings match, and they failed before the change. |

Shows the release that introduced a page's feature as a "Since X.Y.Z" badge in the sticky header, next to the Beta and Limited Availability badges. The tooltip reads "Introduced in version X.Y.Z.", or "Introduced in X.Y.Z." when the page sets
:page-introduced-in-product:. The badge renders only when the page sets:page-introduced-in:, and never on Cloud pages. A leadingvor trailing period in the value is stripped.Generated Connect reference pages will set the attribute from the component spec (redpanda-data/connect, branch docs/introduced-in-attribute), replacing the "Introduced in version" sentence in the page body. Cloud pages don't set it, and the template hides the badge on Cloud anyway.
Verified with a local Antora build using this bundle: self-managed
inputs/sap_hanaandinputs/redpandashow the badge, and the Cloudinputs/redpandapage shows none.gulp lintpasses.Preview page: https://deploy-preview-452--docs-ui.netlify.app/introduced-in-test.html (sets
:page-introduced-in: 4.43.0). The Limited Availability Test page is the control and shows no version badge.More preview pages: https://deploy-preview-452--docs-ui.netlify.app/introduced-in-combo-test.html (with Beta and Limited Availability, product named) and https://deploy-preview-452--docs-ui.netlify.app/introduced-in-cloud-test.html (Cloud, no badge). Template tests:
npm run test:introduced-in-badge, run in validate-build.Merge this first, then redpanda-data/docs-extensions-and-macros#394 (keeps the version in the Markdown front matter), then connect, so no page loses its version before the badge and the Markdown copy have it.