docs: hover-anchor headings + New/Updated sidebar badges#43
Open
abdout wants to merge 1 commit into
Open
Conversation
Phase 4 polish. Two changes that make the docs feel current and discoverable without rewiring infrastructure. - Hover-anchor # next to every h2/h3/h4. Slugify helper extracted so ids are stable across renders and consistent across heading levels. Anchor is opacity-0 by default and fades in on group-hover or when the link itself receives focus (keyboard-accessible). - src/lib/docs.ts declares PAGES_NEW (4 entries, the Phase 3 resources) and PAGES_UPDATED (10 entries, the pages templated in Phase 2 and 3). - Sidebar renderLink now reads those arrays and shows a small inline badge (primary tint for New, muted for Updated). New beats Updated if both are flagged. Why: hover-anchors are the simplest way to give every section a permanent, copy-able URL. Badges surface what's worth re-reading without forcing users to scan the changelog. Deferred: mobile sidebar via Sheet — it needs the shadcn Sidebar component switched from collapsible="none" to "offcanvas" plus a layout-level SidebarTrigger, which risks regressing desktop behavior. Splitting into its own PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
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.
Summary
Phase 4 of the shadcn-style docs refresh. Stacked on top of #42. Targets
docs/shadcn-new-sectionsand should be merged after #42 lands. Rebase onto main after that.Two polish primitives that move kun docs the rest of the way toward shadcn parity without rewiring infrastructure: hover-anchor
#next to every section heading, and smallNew/Updatedbadges in the sidebar.Changes
src/mdx-components.tsx— extractslugify()helper, add<HeadingAnchor>component, apply to h2/h3/h4. Anchor isopacity-0and fades in ongroup-hoveror when the link itself receives focus (keyboard-accessible).src/lib/docs.ts(new) —PAGES_NEWandPAGES_UPDATEDarrays. New entries currently flag the 4 Phase 3 resources pages (FAQ, changelog, theming, CLI). Updated flags the 10 pages templated in Phase 2 / 3.src/components/docs/docs-sidebar.tsx—renderLinkreads both arrays and shows an inline badge. New beats Updated if both flagged.Test plan
pnpm docs:checkclean (40 / 40 / 0)next buildsucceeds#fades in, click copies URLOut of scope
<Sidebar collapsible="none">would need to flip to"offcanvas"plus a layout-level<SidebarTrigger>, and that risks regressing desktop. Splitting into its own PR.createFromSourcefor free, but the dialog UI is a real surface area. Separate PR.🤖 Generated with Claude Code