Skip to content

fix(ui): sidebar active fill overshoot, text shift, sticky TOC and token rhythm - #306

Merged
vshengbro merged 1 commit into
masterfrom
fix/docs-sidebar-toc-spacing
Oct 10, 2026
Merged

vshengbro merged 1 commit into
masterfrom
fix/docs-sidebar-toc-spacing

Conversation

@vshengbro

Copy link
Copy Markdown
Collaborator

Summary

Fixes five defects in the docs shell, all verified against a local build of the docs site.

Sidebar

  • side-indent was 17px (margin 8 + padding 8 + border 1), but an active row keeps its own padding, so the fill landed 8px past the dashed guide. Corrected to 9px (margin + border) in both themes.
  • That negative margin also dragged the label 9px left. It's now paid back with padding-left: calc(space-md + side-indent-num) — the two cancel for the text while the background still reaches the guide. Measured 0px text shift at root, depth-1 and depth-2, with row height held at 48px in all states.
  • Hover already used inset box-shadow and never moved text; left as is.

TOC

  • c_euv_doc_layout inherited flex-shrink: 1 as a flex item of the scroll container's column. It was therefore clamped to its min-height: 100% floor (824px) despite 12780px of content, and a sticky descendant can only travel inside its containing block — so the TOC unpinned after roughly one viewport of scroll. flex-shrink: 0 restores the full range; verified pinned at a constant 100px offset through 11000px of scroll.
  • Pinned at padding-main-top rather than a bare 0, so it keeps the same breathing room below the container edge as the article.
  • Active entries bold at 700; hover no longer bolds. The docs override set font-weight: 700 on :hover in both light and dark — that contradicted the rule and is corrected.

Markdown rhythm

  • Replaced em-based heading/block margins with space-sm / gap-component, so article copy sits on the same token scale as the rest of the UI. Article spacing measured 16px against the example's 8px; now a uniform 8px.

Links

  • .md-body a restyled itself on hover (dashed → solid underline, accent colour). Now one static treatment for both states.

Padding

  • Deleted the padding-main-bottom token and both usages in c_app_main rather than zeroing it.

Verification

  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets — 0 warnings
  • cargo test --workspace --all-features — all suites passing
  • Browser-measured on a locally built docs bundle at 1440×900: sidebar text x, fill overshoot, row height, TOC offset across scroll positions, and article rhythm

Version bumped to 0.28.20 with workspace path-dep pins realigned, since the sync workflows skip on PRs.

Notes

The docs deploy workflow is failing independently of this change — Install euv-cli fails to compile euv-cli v0.28.15 with cannot find value NO_CACHE_NO_STORE_MUST_REVALIDATE. That blocks any docs deploy, before and after this PR, and is not addressed here.

…ken rhythm

Sidebar
- `side-indent` was 17px (margin 8 + padding 8 + border 1) while an active
  row keeps its own padding, so the fill landed 8px past the dashed guide.
  Corrected to 9px (margin + border) in both themes.
- The active fill's negative margin also dragged the label 9px left. Pay it
  back with `padding-left: calc(space-md + side-indent-num)` so the two
  cancel for the text while the background still reaches the guide. Verified
  0px text shift at root, depth-1 and depth-2 with height held at 48px.
- Hover already used inset `box-shadow` and never moved text; left as is.

TOC
- `c_euv_doc_layout` inherited `flex-shrink: 1` as a flex item of the scroll
  container's column, so it was clamped to its `min-height: 100%` floor
  (824px) despite 12780px of content. A sticky descendant can only travel
  inside its containing block, so the TOC unpinned after one viewport.
  `flex-shrink: 0` restores the full sticky range.
- Pin the column at `padding-main-top` instead of a bare `0` so it keeps the
  same breathing room below the container edge as the article.
- Active entries bold at 700; hover no longer bolds (the docs override set
  `font-weight: 700` on `:hover` in both light and dark).

Markdown rhythm
- Replace em-based heading/block margins with `space-sm` / `gap-component`
  so article copy sits on the same token scale as the rest of the UI.
  Article spacing measured 16px against the example's 8px.

Links
- `.md-body a` restyled itself on hover (dashed -> solid, accent colour).
  One static treatment for both states.

Padding
- Delete the `padding-main-bottom` token and both usages in `c_app_main`
  rather than zeroing it.

Verified against a local docs build: cargo fmt --check clean, clippy 0
warnings, full test suite passing.
@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Oct 9, 2026
@vshengbro
vshengbro merged commit 2ac8446 into master Oct 10, 2026
8 checks passed
@vshengbro
vshengbro deleted the fix/docs-sidebar-toc-spacing branch October 10, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant