Repository navigation
feat(docs): badge the four newest items per type in the sidebar - #28
Merged
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.
|
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.
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.mainnever got the change: there is noaddedAtand nolib/new-items.ts.This is the same commit, cherry-picked onto
mainwith no conflicts. See #27 for the full description: the four newest components and blocks get a "New" badge in the sidebar, anaddedAtdate replaces the hand-setisNewflag, and the gallery's "New" section is removed.Typecheck is clean, and the registry, navigation and new-items tests pass.