Repository navigation
feat(docs): badge the four newest items per type in the sidebar - #27
Merged
Arifulislam5577 merged 1 commit intoOct 7, 2026
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Arifulislam5577
merged commit Oct 7, 2026
d09663b
into
feat/loader-and-testimonial-blocks
3 checks passed
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the "New" badge into the sidebar and makes it automatic: the four newest components and the four newest blocks wear it, and adding a fifth pushes the oldest off.
What changes
addedAtreplacesisNew. Every registry entry now records the day it joined, asYYYY-MM-DD. It's required by the type and checked by the registry test, so no new item can skip it. All 48 entries are backfilled from the day each item's source file was first committed.lib/new-items.ts.newestOfTypesorts byaddedAt, newest first, and breaks a same-day tie by registry order (the entry appended later counts as newer), then keepsNEW_LIMIT = 4. Components and blocks are counted separately.flattenSectionstakes anisNewpicker and marks matching catalog pages on the server. The client sidebar only reads a boolean per row and never imports the registry.tween-accenttoken (deep teal in light, soft teal in dark). The old card badge hard-coded the light teal, which was faint on the dark background.Worth calling out in review
registry-ui.tsisn't in the order items were added. Magnetic Button and Dot Bloom Button were added last but sit among the other buttons, so array position couldn't tell "newest" apart.addedAtto today. Nothing else needs touching; the oldest badge drops on its own.Checks
Typecheck is clean,
registry:buildpasses and the full suite passes (956 tests). The new tests cover the limit, the fifth-item rollover, same-day ties, per-type counting, the live registry, the sidebar marking and a valid date on every entry. Checked in headless Chrome: exactly 4 + 4 badges in the sidebar and on the cards, in light and dark themes, with no "New" section.next buildwas not run locally.