Repository navigation
fix(docsite): default changelog to core, sync tab with URL, fill empty releases - #5362
HelloOjasMutreja wants to merge 1 commit into
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The Vercel deployment check is failing, but I don't think it's caused by this diff. This PR touches exactly 3 files, all in Ran I don't have Vercel CLI credentials in this environment to pull the actual deployment logs ( |
|
Visual evidence, since I skipped it earlier and shouldn't have — both changes are directly visible on the page. Default tabBefore, landing on The before screenshot also happens to catch the second bug in the same frame: a bare Empty releases
Both captured against a real |
rubyycheung
left a comment
There was a problem hiding this comment.
Defaulting the changelog to @astryxdesign/core makes sense, but the tab order should reinforce that hierarchy. This change selects Core while leaving @astryxdesign/cli as the first tab, so the page opens with a lower item active and the navigation still visually presents CLI as primary.
Please also move Core to the first tab position—Core first, CLI second, followed by the remaining packages—so the displayed order and default selection communicate the same priority. The URL synchronization and explicit empty-release message otherwise look good.
|
Closing in favor of #5309, which implements the same changelog fixes and now reflects the resolved direction: Core first, CLI second, with theme package changelogs omitted. I also brought over the additional empty-release edge-case tests from this PR. Thanks for the careful implementation and visual verification. |




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
ChangelogViewpickedchangelogs[0]?.pkgas the initial tab, andpackages(frompackageRegistry.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=activeTabis now derived straight fromsearchParams.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 patternComponentDetailClientalready uses for its own tab state (searchParams.get('tab'),router.replace(..., {scroll: false})on change, no separateuseState). 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 realCHANGELOG.mdfiles, e.g.packages/themes/y2k/CHANGELOG.md's0.4.6/0.4.5/0.4.2entries).fillEmptyReleases()inchangelogLinkify.tsfills 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.tsxfirst, 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 ofChangelogView'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
fillEmptyReleasesunit 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 devhere 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.