Repository navigation
Load documentation by page and examples near the viewport - #59
Open
Floating-Y wants to merge 2 commits into
Open
Floating-Y wants to merge 2 commits into
Floating-Y wants to merge 2 commits into
Conversation
Signed-off-by: danwood <118035379+Floating-Y@users.noreply.github.com>
Signed-off-by: danwood <118035379+Floating-Y@users.noreply.github.com>
WaylandYang
requested changes
Oct 21, 2026
WaylandYang
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this — splitting the docs into per-page bodies, lazy-loading Home/DocPage and mounting previews near the viewport is a direction we want, and the write-up of what you checked is very thorough. A few things before we can take it:
- Please split out the Windows changes. CRLF normalization in
build-docs.mjsand running the registry CLI vianode_modules/shadcn/dist/index.jsare unrelated to loading boundaries. The latter also depends on a private path inside theshadcnpackage that can move in any release; if we do this, resolve the package'sbininstead. A separate small PR is easier to review and revert. - No per-example special case in
ComponentPreview.name === "chart-demo" && "h-[404px]"puts one example's layout into the generic preview. If the chart needs reserved height, give it a minimum height where its preview is declared (itsclassNamein the page) or in the example itself. scripts/check-component-preview.html. The repository deliberately has no unit tests and CI doesn't run this page, so it would go stale. Please drop it from this PR; the behaviours it covers are well described in the PR text.- The read-back in
build-docs.mjs. Writing every file and then re-reading and deep-comparing it against what was just written is more machinery than the risk warrants. Keeping the unique-key/slug assertions and the stale-file cleanup is enough. - A failed source fetch takes down the whole page.
useSourcenow throws intoDocErrorBoundary, so one failed?rawrequest replaces the entire document with "Unable to load this document". Please keep that failure local to the code panel (e.g. an inline message there) and reserve the document boundary for the body itself. - Anchors with placeholders. Placeholders reserve 208px while real previews are often taller, so on a direct
#hashlink previews just above the target activate and push it down. Browsers without scroll anchoring (Safari in particular) will land in the wrong place. Please check this outside Chrome, or re-scroll to the target once the previews around it have settled.
Happy to look again once these are in. Thanks!
This branch has not been 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.
Why
The shared entry loaded home-page charts and every document body on unrelated routes. Standalone Block previews also imported the listing's Code panel and highlighter. Within a document, every ComponentPreview still mounted its example and requested its raw source immediately, including previews far below the viewport and unused source for hideCode previews.
What changes
How it was checked
Based on dev b328113; retains upstream fragment-link and malformed-escape fixes.
Current preview implementation:
Earlier route-split validation, recorded for a264b58:
Other browsers and physical devices were not tested. Auto-height placeholders remain estimates (Chart measured 404px before loading and about 431px afterward at a 506px viewport). Existing nativeButton and value/defaultValue development warnings remain outside this change. No speedup percentage is claimed.
Before review