Issue 608
tech-debt: make the On this page menu follow the component rules
Back to our planDone
frontendtech-debtuxpriority: high
Problem
In plain words: the "On this page" menu (#574, merged in #607) broke our own rules: it uses raw <a> tags instead of the shared Link, its offsets (144px scroll margin, 160px reading line, bar height) are literals in three places that only agree by hand, and the post and event pages repeat the same section wiring. The self-review step wasn't run before the PR, and two reviewer findings were accepted as "minor".
Proposed fix
- Use the shared
Link(itsnavvariant or a new variant) for the menu links. - Put the header height, bar height, scroll margin and reading line in one shared constant, used by
OnThisPage,RichTextand the gallery. - One shared helper for "sections + whether to show the menu", used by both pages.
- The two accepted minors: with JavaScript off the phone menu stays open after a pick (fix: don't make the bar sticky without script, or close via
:target); the bar width at 640–767px; and check the desktop focus ring isn't clipped byoverflow-y-auto. - Run the
self-reviewskill and put the result in the PR.
Acceptance criteria
- Not done: No raw
<a>or<details>outsidesrc/platform/uiLink/kit components; no copied class strings. - Not done: Offsets defined once; changing one moves every use.
- Not done: Posts and events share one helper; no duplicated wiring.
- Not done: Both accepted minors fixed, with a test or screenshot each.
- Not done: Self-review result in the PR.
Area
frontend, ux
Priority
high
Generated by Claude Code, opens in a new tab