Skip to content

docs(fix[spa-nav]): SPA navigation scroll to hash anchors [DO NOT MERGE yet]#680

Closed
tony wants to merge 3 commits into
masterfrom
spa-navigation-scroll
Closed

docs(fix[spa-nav]): SPA navigation scroll to hash anchors [DO NOT MERGE yet]#680
tony wants to merge 3 commits into
masterfrom
spa-navigation-scroll

Conversation

@tony
Copy link
Copy Markdown
Member

@tony tony commented May 23, 2026

Summary

  • Remove stale docs/_static/js/spa-nav.js that shadowed the theme's corrected version — it used document.querySelector(hash) which silently fails on Python API IDs containing dots (CSS interprets them as class selectors)
  • Pin sphinx-ux-autodoc-layout to gp-sphinx branch spa-navigation-scroll (layout(fix[expandForHash]): listen for gp-sphinx:navigated on SPA navigation git-pull/gp-sphinx#44) to pick up the layout.js fix that adds a gp-sphinx:navigated listener for SPA hash-anchor expansion
  • [DO NOT MERGE] Temporarily add branch to docs workflow trigger to test on live site — revert before merge

Test plan

  • CI docs workflow publishes from this branch
  • Navigate to history page, click an API link with hash fragment — page scrolls to target
  • Browser back/forward works correctly
  • Opening URL with hash in new tab still works
  • Before merge: revert workflow change and uv.sources override once gp-sphinx releases

tony added 3 commits May 23, 2026 18:30
…ion-scroll branch

why: Pick up layout.js fix that adds gp-sphinx:navigated listener for
SPA hash-anchor expansion (git-pull/gp-sphinx#44).
what:
- Add [tool.uv.sources] override pointing sphinx-ux-autodoc-layout to
  the spa-navigation-scroll branch of gp-sphinx
- Update uv.lock
why: The local docs/_static/js/spa-nav.js shadowed the theme's
corrected version. It used document.querySelector(hash) which fails
silently on Python API IDs containing dots (CSS interprets dots as
class selectors). The theme's version uses getElementById().
what:
- Remove docs/_static/js/spa-nav.js (254 lines)
- Sphinx will now resolve js/spa-nav.js from sphinx-gp-theme's
  bundled static files
why: Test SPA navigation scroll fix on the live docs site.
what:
- Add spa-navigation-scroll to docs workflow branch trigger
- Must be reverted before merge
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.37%. Comparing base (643db60) to head (600702b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #680   +/-   ##
=======================================
  Coverage   51.37%   51.37%           
=======================================
  Files          25       25           
  Lines        3488     3488           
  Branches      686      686           
=======================================
  Hits         1792     1792           
  Misses       1401     1401           
  Partials      295      295           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony
Copy link
Copy Markdown
Member Author

tony commented May 23, 2026

Superseded — gp-sphinx 0.0.1a21 ships the expandForHash fix, and the bundled spa-nav.js has been removed from master.

@tony tony closed this May 23, 2026
@tony tony deleted the spa-navigation-scroll branch May 23, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant