Skip to content

feat(docs): badge the four newest items per type in the sidebar - #28

Merged
Arifulislam5577 merged 1 commit into
mainfrom
feat/new-badge-sidebar-main
Oct 7, 2026
Merged

Arifulislam5577 merged 1 commit into
mainfrom
feat/new-badge-sidebar-main

Conversation

@moshiur01

Copy link
Copy Markdown
Contributor

Re-lands #27 on main.

#27 was stacked on #26's branch. #26 merged first, so when #27 merged it landed in feat/loader-and-testimonial-blocks, which had already been merged and goes nowhere. main never got the change: there is no addedAt and no lib/new-items.ts.

This is the same commit, cherry-picked onto main with no conflicts. See #27 for the full description: the four newest components and blocks get a "New" badge in the sidebar, an addedAt date replaces the hand-set isNew flag, and the gallery's "New" section is removed.

Typecheck is clean, and the registry, navigation and new-items tests pass.

Replace the hand-set `isNew` flag with an `addedAt` date on every
registry entry, backfilled from the day each item's source file was
first committed. One rule now picks the four newest components and the
four newest blocks: newest `addedAt` first, a same-day tie going to the
entry appended later. Adding a fifth item pushes the oldest badge off,
with nothing to clear by hand.

The badge moves into the sidebar: `flattenSections` takes a picker and
marks matching catalog pages on the server, so the client sidebar never
loads the registry. Gallery cards keep their badge through the same
rule, and both now use the theme's accent token, so the badge reads in
dark mode too. The gallery's separate "New" section is removed.

Tests cover the limit, the fifth-item rollover, same-day ties, separate
counting per type, the live registry, the sidebar marking, and a valid
`addedAt` on every entry.
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tween-ui Ready Ready Preview Oct 7, 2026 6:12am UTC

@Arifulislam5577
Arifulislam5577 merged commit 13ded08 into main Oct 7, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 57f86d36 Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants