fix local docs version selector interaction - #353
Merged
AjayThorve merged 3 commits intoJul 15, 2026
Merged
Conversation
Signed-off-by: Ajay Thorve <athorve@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (4)
WalkthroughAdds validated local documentation version metadata and a hostname-gated preview script that rewrites the version switcher URL and hides production consent UI during local previews. ChangesLocal documentation preview
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant local-preview.js
participant DOCUMENTATION_OPTIONS
participant versions-local.json
Browser->>local-preview.js: Load on a supported local hostname
local-preview.js->>DOCUMENTATION_OPTIONS: Rewrite theme_switcher_json_url
Browser->>versions-local.json: Fetch local version metadata
local-preview.js->>Browser: Inject styles hiding OneTrust UI
Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Ajay Thorve <athorve@nvidia.com>
Signed-off-by: Ajay Thorve <athorve@nvidia.com>
AjayThorve
marked this pull request as ready for review
July 15, 2026 22:48
AjayThorve
merged commit Jul 15, 2026
d32b045
into
NVIDIA-AI-Blueprints:release/2.2
8 of 9 checks passed
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.
Overview
Fix the documentation version selector when generated HTML is served from
localhostor another loopback address.There are two independent browser failures:
https://docs.nvidia.com/aiq-blueprint/versions1.jsondoes not return anAccess-Control-Allow-Originheader, so browsers block local previews from reading the publisher-managed index and the NVIDIA Sphinx theme leaves the selector empty.This change preserves the publisher-managed version index and normal consent behavior for deployed documentation. On loopback hosts only, a local-preview bootstrap uses a bundled same-origin version index and suppresses the production consent UI with CSS. It does not accept cookies, reject cookies, or mutate consent state. The Sphinx configuration also rejects builds when the local index's preferred version diverges from
project.json.DCO sign-off for the squash commit
Signed-off-by: Ajay Thorve athorve@nvidia.com
Signed-off-by: Ajay Thorve AjayThorve@users.noreply.github.com
Validation
pre-commit run --files docs/source/conf.py docs/source/versions-local.json docs/source/_static/js/local-preview.js docs/README.mduv run --extra docs sphinx-build -M html docs/source docs/builduv run --extra docs sphinx-build -M linkcheck docs/source docs/builddocs/build/htmlwithpython3 -m http.server 3000and exercised/get-started/using Playwright with a fresh system Chrome profile./, no visible consent banner or overlay, a clickable2.2.0-rc1selector, and menu entries for2.2.0-rc1,2.1.0,2.0.0, and1.2.1.git commit -sor an equivalent sign-off.Where should reviewers start?
Review
docs/source/_static/js/local-preview.jsfor the loopback-only behavior anddocs/source/conf.pyfor the build-time version invariant.Related Issues
Summary by CodeRabbit
New Features
Documentation