Skip to content

Hub pages 4/4: {whats-new} - #3829

Merged
Mpdreamz merged 5 commits into
feature/hub-get-startedfrom
feature/hub-whats-new
Aug 14, 2026
Merged

Hub pages 4/4: {whats-new}#3829
Mpdreamz merged 5 commits into
feature/hub-get-startedfrom
feature/hub-whats-new

Conversation

@florent-leborgne

@florent-leborgne florent-leborgne commented Aug 11, 2026

Copy link
Copy Markdown
Member

Part 4 of 4, based on #3827. Implements elastic/docs-content-internal#1383.

Demo: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/3829/examples/products/docs-builder

A recency panel for a hub page. A reader who bookmarks a hub wants a quick answer to "what changed recently" without hunting through release notes.

With this merged, docs/examples/products/docs-builder.md is a complete hub page.

Usage

One line for the common case:

:::{whats-new}
:product: docs-builder
:::

Omitting :product: accepts the same schema as an inline YAML body, for a one-off panel.

Implementation choices

The panel content lives in the content repository. The prototype reads config/whats-new.yml from docs-builder, so a writer editing a highlight card opens a pull request against the build tool and waits for a release. It now reads hub-whats-new.yml from the root of the current documentation set, beside changelog.yml and redirects.yml.

That makes the directive documentation-set scoped. It cannot render another repository's panel, and no syntax would fix it. Cross-link resolution maps pages through the link index, and a YAML data file is not a page. In an isolated build the other repository is not checked out, so there is no file to read. Every hub page lives in the same repository as its content file, so this costs nothing today. elastic/docs-content-internal#1383 has been updated to drop the earlier claim that any page could render any product's panel.

Three schema fields are removed. items[].meta and the top-level badge are in the prototype's schema but no view reads them. An option that renders nothing is worse than no option. items[].badge is removed too: a badge reading "New" inside a What's new panel is redundant, and tag already carries per-item categorisation.

A card hovers grey, not pale blue. The previous hover border read at 2.12:1 against white, so the state was barely visible. It now matches every other linked card on a hub page.

The date renders as written. Nothing forces uppercase, so a writer controls the casing and a month name in any language survives.

Machine-readable output. The LLM export keeps the date and tag alongside each title, which is what a reader asking "what changed recently" wants. The search body gets nothing, as with the other hub directives.

Example content

docs/hub-whats-new.yml uses every remaining field once, including two release-links and an upgrade-link, so it can be copied and trimmed. It carries five items, which fills the three-column grid cleanly alongside the two-column featured card.

Follow-up, not in this change

A skill in docs-content that updates hub-whats-new.yml from the release notes of each product with a hub page. It should read the changelog YAML bundles rather than rendered pages, since those are structured and already feed release notes.

Testing

./build.sh unit-test passes. dotnet format and npm run fmt:check are clean. A full docs build reports 0 errors and 0 warnings.

tests/authoring/Blocks/Hub/WhatsNew.fs covers the inline-body path, the featured card spanning two columns, release and upgrade links, and three failure paths including an unresolvable product key.

Screenshots to add or update

None attached. The five-card grid with its featured span is worth checking on the preview.

@florent-leborgne
florent-leborgne force-pushed the feature/hub-whats-new branch 2 times, most recently from 6e7eae7 to 20978d4 Compare August 11, 2026 16:17
florent-leborgne and others added 5 commits August 13, 2026 19:10
A recency panel for a hub page. A reader who bookmarks a hub wants a quick answer
to "what changed recently" without hunting through release notes.

The panel content moves out of the build tool. The prototype reads
config/whats-new.yml from docs-builder, which means a writer editing a highlight
card opens a pull request against the build tool and waits for a release. It now
reads hub-whats-new.yml from the root of the current documentation set, beside
changelog.yml and redirects.yml.

That makes the directive documentation-set scoped. It cannot render another
repository's panel, and this is a constraint rather than a syntax gap.
Cross-link resolution maps pages through the link index, and a YAML data file is
not a page. In an isolated build the other repository is not checked out, so
there would be no file to read. Every hub page lives in the same repository as
its content file, so the limit costs nothing today.

The common case stays one line, `:product: <key>`. Omitting it accepts the same
schema as an inline YAML body, for a one-off panel.

Adds containsRawHtml to the authoring assertions. The pretty-printed comparison
only matches a childless element or a snapshot taken from the outermost element
of the directive output, so asserting a class on a container previously meant
snapshotting its whole subtree.

Follow-up, not in this change: a skill in docs-content that updates
hub-whats-new.yml from the release notes of each product that has a hub page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Martijn's review on #3825 covered the whole page, so the same rule applies
here. What's new type moves onto the site's scale. Every raw font size in
hub.css is now a scale token.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Martijn's point about tiny fonts applies to every piece of hub text. Card
descriptions, release note links, and the footer now read at the body size.
Card meta sits one step down at 14px. No hub text renders below 14px, and
nothing uses the smallest step of the scale.

The card date no longer forces uppercase. It is authored, so it keeps the
casing the writer chose. The example data and the syntax page now use
sentence case to match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The card link and the upgrade link both send the reader onward, which is one
of the two cases the site marks with an arrow. They now use the same glyph
and hover slide as every other hub arrow. No hub directive draws its own
arrow any more.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The card hovered to a pale blue border reading 2.12:1 against white, so the
state was barely visible. It now uses grey-80 at 4.15:1, the same treatment
as every other card on a hub page that is itself a link.

Every card that is a link now hovers the same way, and every state border
in the hub clears the 3:1 ratio.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@florent-leborgne
florent-leborgne marked this pull request as ready for review August 14, 2026 09:10
@florent-leborgne
florent-leborgne requested review from a team as code owners August 14, 2026 09:10
@Mpdreamz
Mpdreamz merged commit 67babd2 into main Aug 14, 2026
25 checks passed
@Mpdreamz
Mpdreamz deleted the feature/hub-whats-new branch August 14, 2026 10:20
yetanothertw pushed a commit that referenced this pull request Aug 14, 2026
* Add {whats-new}

A recency panel for a hub page. A reader who bookmarks a hub wants a quick answer
to "what changed recently" without hunting through release notes.

The panel content moves out of the build tool. The prototype reads
config/whats-new.yml from docs-builder, which means a writer editing a highlight
card opens a pull request against the build tool and waits for a release. It now
reads hub-whats-new.yml from the root of the current documentation set, beside
changelog.yml and redirects.yml.

That makes the directive documentation-set scoped. It cannot render another
repository's panel, and this is a constraint rather than a syntax gap.
Cross-link resolution maps pages through the link index, and a YAML data file is
not a page. In an isolated build the other repository is not checked out, so
there would be no file to read. Every hub page lives in the same repository as
its content file, so the limit costs nothing today.

The common case stays one line, `:product: <key>`. Omitting it accepts the same
schema as an inline YAML body, for a one-off panel.

Adds containsRawHtml to the authoring assertions. The pretty-printed comparison
only matches a childless element or a snapshot taken from the outermost element
of the directive output, so asserting a class on a container previously meant
snapshotting its whole subtree.

Follow-up, not in this change: a skill in docs-content that updates
hub-whats-new.yml from the release notes of each product that has a hub page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Apply review feedback to the what's new section

Martijn's review on #3825 covered the whole page, so the same rule applies
here. What's new type moves onto the site's scale. Every raw font size in
hub.css is now a scale token.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Raise what's new text to body size, and stop shouting the date

Martijn's point about tiny fonts applies to every piece of hub text. Card
descriptions, release note links, and the footer now read at the body size.
Card meta sits one step down at 14px. No hub text renders below 14px, and
nothing uses the smallest step of the scale.

The card date no longer forces uppercase. It is authored, so it keeps the
casing the writer chose. The example data and the syntax page now use
sentence case to match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Use the shared arrow in what's new

The card link and the upgrade link both send the reader onward, which is one
of the two cases the site marks with an arrow. They now use the same glyph
and hover slide as every other hub arrow. No hub directive draws its own
arrow any more.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Give a what's new card the shared card hover

The card hovered to a pale blue border reading 2.12:1 against white, so the
state was barely visible. It now uses grey-80 at 4.15:1, the same treatment
as every other card on a hub page that is itself a link.

Every card that is a link now hovers the same way, and every state border
in the hub clears the 3:1 ratio.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants