Repository navigation
fix(ui): sidebar hover bar alignment, dashed links, TOC scroll-spy activation - #307
Merged
Merged
Conversation
The docs shell paints the hover indicator as a `::before` bar, and the two row kinds sat at different offsets from the dashed tree guide: leaf links at `left: -8px`, group titles at `left: -2px`. A group title therefore hovered with its bar floating 7px away from its guide while a leaf link sat 1px away, so the two kinds did not read as the same control. Both are now `-8px`, which puts each bar 1px from the guide that row actually hangs off. Also switch the markdown link underline back to dashed. It was solid after the previous pass removed the hover variant, which flattened the distinction between a link and surrounding body text. Still one static rule for both states — no `:hover` restyle. Verified against a local docs build at 1440x900: group titles and leaf links both report a 1px gap to their guide at every nesting depth, the underline computes as dashed, and no `.md-body a:hover` rule exists.
…the sidebar guide with the hover bar TOC scroll spy (docs): the old hash matcher compared the percent-encoded location.hash fragment against raw UTF-8 href fragments, so no entry ever matched and nothing was ever marked active. It also only reacted to hashchange, so scrolling never updated the active entry. Rewritten to: decode the fragment before comparing, track the section at the top of the scroll container on scroll events, fall back to the first entry on plain load and to the last entry when scrolled to the bottom, and only touch class lists when the active entry actually changes so the MutationObserver cannot re-trigger itself. The existing rules then render the active entry bold at 700 while hover stays at 400. Sidebar hover bar (docs): the ::before indicator sat 1px to the right of the dashed tree guide (-8px), leaving the guide visible as a separate stroke next to the bar. Moved to -9px so the bar starts exactly at the guide and covers it, matching the active-fill edge which already starts at the guide. Verified bar-left == guide-left at both nesting depths.
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
Three fixes to the docs shell, all verified against a local docs build at 1440x900.
Sidebar group-title hover bar — the ::before indicator used a different offset
for group titles (-2px) than for leaf links (-8px), so a hovered group title showed
its bar floating 7px away from the dashed tree guide while a leaf link sat 1px away.
Both are now -9px, which puts the bar's left edge exactly on the guide at every
nesting depth: the bar covers the guide, matching the reference look and the
active-fill edge, which already starts at the guide. Measured bar-left == guide-left
at depth 1 and 2 for both row kinds.
Markdown link underline — back to dashed (it was flattened to solid when the
hover variant was removed). Still one static rule, no :hover restyle.
TOC scroll spy — the active-entry highlighter never worked: it compared the
percent-encoded location.hash fragment against raw UTF-8 href fragments, so nothing
ever matched, and it only listened to hashchange, so scrolling never activated
anything. Rewritten to percent-decode before comparing, track the section at the
top of the scroll container on scroll, fall back to the first entry on plain load
and the last entry at the bottom, and mutate class lists only when the active entry
actually changes (the old version could re-trigger its own MutationObserver). The
pre-existing CSS then renders the active entry at font-weight 700; hover on
inactive entries stays 400.
Verification
on the guide; row height 48px in all states
Version 0.28.21, workspace pins realigned.