Repository navigation
Keep documentation version links as a fallback - #195
Conversation
Hide the extra Versions link when the dropdown is usable. Keep the link available when scripts or catalog loading are unavailable, and style its destination with the guide's palette and typography. Signed-off-by: Trent Nelson <trentn@nvidia.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
melo-gonzo
left a comment
There was a problem hiding this comment.
Thanks. I read this at 96af56b, and the fallback logic holds. This is from code reading; I did not render the guide.
- Each page renders the
<select>disabled, with the Versions link right after it (transforms.py:276-285), so the new rule matches. selector.jsenables the select only after it loads a valid catalog that lists the current version. A failed fetch, a wrong schema or a missing version all leave it disabled, so the link still shows. The same holds with JavaScript off.check_archiveonly checks thatversions.htmlexists, so the new page style does not trip validation of the retained archive.
Three notes for a follow-up. None blocks this PR.
- In light mode, the link text on the hover background is 4.26:1. That is under the 4.5:1 WCAG AA level for normal text. A link color of
#387a00gives 5.31:1 on white and 4.93:1 on hover. Dark mode passes. - Each snapshot has a copy of
selector.cssunder_version/(transforms.py:322-325)._reusekeeps release snapshots whatever the controller commit (publisher.py:180-190). Released guides therefore keep the Versions link next to the dropdown, and onlymainand later releases get this change.assemblerebuildsversions.htmlfor the whole archive, so the new page style shows everywhere. - The rule depends on the link coming right after the
<select>. A check intest_transforms.pythatsoup.select_one("#cuphoton-version-select + a")finds theversions.htmllink would catch a markup change that leaves the link always visible.
Contrast ratios (WCAG 2 relative luminance)
light link #3f8500 on #ffffff 4.60
light hover #3f8500 on #f5f7f2 4.26
dark link #76b900 on #181818 7.36
dark hover #76b900 on #252821 6.20
proposed #387a00 on #ffffff 5.31, on #f5f7f2 4.93
Darken light-theme version links so their normal and hover colors meet the contrast minimum for normal-sized text. Signed-off-by: Trent Nelson <trentn@nvidia.com>
Summary
Hide the extra Versions link when the documentation dropdown is usable, while keeping it available when JavaScript or catalog loading is unavailable. Give the fallback page the guide's fonts, light/dark colors, responsive spacing, and visible keyboard focus.
Validation
Repository hygiene