Skip to content
SprecherEast
Issue 608

tech-debt: make the On this page menu follow the component rules

Back to our plan
Done
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 (its nav variant 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, RichText and 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 by overflow-y-auto.
  • Run the self-review skill and put the result in the PR.

Acceptance criteria

  • Not done: No raw <a> or <details> outside src/platform/ui Link/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

See it on GitHub, opens in a new tab