slot: preserve active tab when navigating between slots#708
Merged
Conversation
Carry the URL hash forward on the prev/next chevrons so e.g. /slot/35#ptcVotes -> next chevron -> /slot/36#ptcVotes lands on the same tab. The chevron href is rewritten on page load, hashchange, and tab switches, so regular, middle, and cmd+click all preserve the tab.
5ae06db to
8a5b548
Compare
6 tasks
pk910
approved these changes
May 21, 2026
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
When viewing a slot with a non-Overview tab open (e.g.
/slot/35#ptcVotes), clicking the prev/next chevron used to drop the hash and land on/slot/36showing Overview. This made it tedious to compare the same tab across several slots.The prev/next chevron anchors are tagged with a
slot-nav-linkclass and the original path is stashed indata-slot-nav-base. A small JS helper rewrites theirhrefto includelocation.hashon page load, onhashchange, and after a tab switch — so regular clicks, middle-clicks, and cmd-clicks all preserve the active tab.A follow-up PR will address the brief Overview flash on uncached navigation (the page lands on the correct tab, but Bootstrap fades from Overview rather than starting on the target tab).
Test plan
/slot/<N>#ptcVotes, click the right chevron → lands on/slot/<N+1>#ptcVoteswith PTC Votes active./slot/<N>#ptcVotes, click the left chevron → lands on/slot/<N-1>#ptcVoteswith PTC Votes active.