feat(home): deep-link and persist the A–Z article index letter in the URL - #1973
Closed
dhgoal wants to merge 1 commit into
Closed
feat(home): deep-link and persist the A–Z article index letter in the URL#1973dhgoal wants to merge 1 commit into
dhgoal wants to merge 1 commit into
Conversation
… URL The home page article index is a client-side A–Z letter filter, but the selected letter lives only in client state: reloading resets it to the first letter, the choice can't be shared, and an incoming #<letter> is ignored. This mirrors the gap the search facets closed in e35ventura#1955. Persist the active letter in the URL hash (history.replaceState — no scroll, kept out of back-button history) and honour an incoming #<letter> on load and on hashchange (back/forward). A hash is validated to a single A–Z that has an article group, so a stray hash (e.g. the #content skip link) or a letter with no articles is ignored and the current selection is untouched. scripts/check-home-index-deeplink.js pins the contract and executes the shipped inline script against a DOM stub to verify the behaviour end to end (deep-link, persistence, hashchange resync, stray-hash guard). Refs e35ventura#521
|
Verdict: Close PR #1973: feat(home): deep-link and persist the A–Z article index letter in the URL This PR changes toggle-driven on-screen behavior. Code analysis confirms the visible effect only appears during the interaction, so static before/after screenshots cannot demonstrate it (an identical-looking pair is not valid evidence). A short screen recording or GIF is required. Visual PRs need evidence in the PR description so the maintainer can review the change quickly and reliably. A deploy preview link alone is not enough. Required evidence for resubmission:
Changed files:
CI: Checks still pending: build Please open a new focused PR with the required evidence attached. Automated review by Taopedia Site Maintainer. |
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
The home page's A–Z article index is a client-side letter filter, but the selected letter lives only in client state. This adds URL-hash deep-linking so the index behaves like the rest of the site's shareable surfaces — the same URL-state treatment the search facets got in #1955.
#<letter>to the URL viahistory.replaceState(no scroll jump, kept out of back-button history).#<letter>is honoured on first load and onhashchange(back/forward).#contentskip-link target) or a letter with no articles is ignored and the current selection is left untouched.Scope is the home page's existing inline script only — no markup, styling, or layout changes.
Why This Should Ship
Issue #521 asks for stronger article discovery on the landing page. Today
taopedia.org/#Mjust shows the default first letter — a shared or reloaded index link silently loses its place. After this, a reader (or a link) can jump straight to a letter and the choice survives reload and sharing. It reuses the exact URL-state pattern the maintainer already accepted for search facets (#1955). Refs #521.Review Notes
src/pages/index.astroinline script) + a test;package.jsonwires the test script.npm run test:home-index-deeplink—scripts/check-home-index-deeplink.jspins the URL-state contract in source and executes the shipped inline script against a DOM stub, verifying deep-link on load, click→#letterpersistence,hashchangeresync, and that stray/foreign hashes are ignored.Before — visiting
/#Mignores the hash (index stuck on the default letter)After — visiting
/#Mdeep-links straight to the M articlesTarget Branch
testmainonly because it promotestestto productionSecurity Checklist
Requested label:
ui-ux