Skip to content

fix(docsite): default changelog to core, sync tab with URL, fill empty releases - #5362

Draft
HelloOjasMutreja wants to merge 1 commit into
facebook:mainfrom
HelloOjasMutreja:fix/docsite-changelog-default-and-empty-state
Draft

fix(docsite): default changelog to core, sync tab with URL, fill empty releases#5362
HelloOjasMutreja wants to merge 1 commit into
facebook:mainfrom
HelloOjasMutreja:fix/docsite-changelog-default-and-empty-state

Conversation

@HelloOjasMutreja

Copy link
Copy Markdown
Contributor

Addresses #5307, partially. Three of the four bullets are done; the fourth needed a decision I didn't want to guess at, so I left it out (details below).

Default to core, not whatever sorts first

ChangelogView picked changelogs[0]?.pkg as the initial tab, and packages (from packageRegistry.ts) is built by scanning package directories, so the first entry is whatever sorts first alphabetically — @astryxdesign/cli, not @astryxdesign/core. Now it prefers @astryxdesign/core, falling back to the first entry only if core has no changelog.

Direct links via ?package=

activeTab is now derived straight from searchParams.get('package') (clamped to a package that actually has a changelog, so a stale or hand-edited value can't land on a blank panel), the same pattern ComponentDetailClient already uses for its own tab state (searchParams.get('tab'), router.replace(..., {scroll: false}) on change, no separate useState). The URL only gets a ?package= param when it differs from the default, so the common case stays a clean /changelog.

Empty releases

A release with no notable changes still gets a version heading from the changeset tooling, with nothing between it and the next heading or the --- separator before it (confirmed against several real CHANGELOG.md files, e.g. packages/themes/y2k/CHANGELOG.md's 0.4.6/0.4.5/0.4.2 entries). fillEmptyReleases() in changelogLinkify.ts fills those bodies with "No changes in this release." Added unit tests covering: a mid-file empty version, the last version in the file (no trailing separator), a version with real content staying untouched, and the stripped package title not being mistaken for an empty version.

What I left out: "keep theme packages out of primary tabs"

I didn't implement this one. Checked ThemePackagePage.tsx first, since "keep out of primary tabs" implies they'd still be reachable somewhere else, and it turns out theme package changelogs aren't shown anywhere but this page today. Filtering them out of ChangelogView's tabs would delete the only place they're visible, not relocate them. That's a real UI decision (a secondary tab group, a dropdown, moving them onto the theme pages, or something else) rather than a one-line filter, so I'd rather it get scoped properly than have me guess. Happy to pick it up once there's a direction, or if it's more of a "just filter them, changelog visibility for themes isn't a requirement" call, say so and I'll do that instead.

Verification

fillEmptyReleases unit tests: 20/20 pass (pnpm -F @astryxdesign/docsite test src/__tests__/changelog-linkify.test.ts). Typecheck (tsc --noEmit) shows no new errors from these files (checked by grepping the full output for "changelog" — all pre-existing errors are elsewhere in the app, unrelated to this change). Lint is clean.

Not verified: an actual browser render of the page. next dev here needs a full data regeneration pass I didn't want to eat the time on, given the tab logic mirrors an already-shipped, working pattern (ComponentDetailClient) line-for-line and the markdown transform is covered by tests against real changelog content. If that's not enough for review, let me know and I'll get a real render.

…empty releases

The changelog page picked whichever package sorted first alphabetically
(@astryxdesign/cli), so it never opened on the package most visitors come
here for. It now prefers @astryxdesign/core, falling back to the first
package only if core has no changelog.

The active tab is now the URL's ?package= query param, following the same
pattern ComponentDetailClient already uses for its own tab state: reading
searchParams directly instead of useState, and updating it via
router.replace(scroll: false) on tab change so it doesn't spam history.
That also gives direct links to a specific package's changelog for free.

A release with no notable changes still gets a version heading from the
changeset tooling, with nothing between it and the next heading or the
separator before it, which reads as a broken page. fillEmptyReleases()
fills those bodies with an explicit "No changes in this release." line.
@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Error Error Aug 23, 2026 4:28pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 23, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review labels Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant