Skip to content

Robustness to new content: nav height, TOC numbering, quoted fences, seo_title - #99

Merged
bits-bytes-nn merged 8 commits into
mainfrom
review-r9
Oct 15, 2026
Merged

bits-bytes-nn merged 8 commits into
mainfrom
review-r9

Conversation

@bits-bytes-nn

Copy link
Copy Markdown
Owner

Fixes from three adversarial review rounds (code/tests/docs and UI/UX), focused on overfitting to the current content. The final round found 0 MAJOR issues.

Overfitting and robustness

  • Nav height: the nav bar's height no longer assumes the current tab count. An 8th tab wrapped the bar at 960px and up, and the fixed bar covered each page's heading. The page now follows the bar's real height through --nav-height. An inline script after the header sets it before first paint (CLS 0.33 → 0.006 with 8 tabs), and js/main.js keeps it in step, with fallbacks for browsers without ResizeObserver or MediaQueryList.addEventListener.
  • TOC: it drops its own numbers when most h2s already carry one. The Insights posts read "2 1. …".
  • Phone menu: the open menu scrolls when a landscape phone is shorter than the list, and keeps room for focus rings while it scrolls.
  • seo_title: it applies to any post's <title>, not only paper posts. A long guide title from scholar-lens was ignored before.
  • Landmark id: the main landmark is main-content, so a ## Content heading cannot collide with it.
  • lang: previous/next titles and home entries carry their post's lang.

New script/lint-posts.rb behaviour (for scholar-lens)

  • Code fences inside a blockquote (> ```…) are code. The <tag>, colon and math rules no longer read them as prose. Liquid is still flagged there, because Jekyll renders it in code too.
    • Passes: > ```text / > 답을 <think> 안에 쓰세요 / `> ````
    • Fails: > 답을 <think> 안에 씁니다.
  • One fence scanner now serves the body and lightbox checks.
    • A quoted fence closes on a quoted marker, or where its blockquote ends (then "code fence never closed").
    • A bare fence closes only on a bare marker, so a `> ```` line inside a ```markdown example stays part of it.
  • HTML elements q, time, var, samp, u, dfn and track are allowed in prose.

_data/post_conventions.yml is unchanged. No post content is changed.

Verification

  • tests: 176 runs, 0 failures
  • lint: 35 posts pass, with output identical to main
  • strict build, htmlproofer and validate-site.sh: all pass
  • realistic scratch posts in a repo copy, built with every gate: a scholar-lens survey, a review, a summary and a guide, plus an 8-tab nav
  • fence handling compared case by case with kramdown GFM output
  • Playwright on 52 pages, light and dark, at 7 widths: no overflow, no broken images, no console errors, 0 axe violations

An eighth tab wrapped the bar to two rows at 960px and up, and the fixed
bar covered each page's heading; the offset was a fixed 66px. main.js
now passes the bar's height as --nav-height. Also: the main landmark's
id is main-content, so a '## Content' heading cannot collide with it;
the lint allows q, time, var, samp, u, dfn, track and the SVG marker and
ellipse; the categories description no longer lists the types.
…phone menu

The Insights posts number their h2s, so the TOC read '2 1. …'. Held
sideways, a phone is shorter than the open menu, whose last items sat
off-screen. Previous/next titles and home-page entries carry their own
post's lang.
scholar-lens quotes prompts as '> ```' blocks; the lint read their <tag>
lines as prose. The lightbox check skips such fences too.
With a two-row bar the page painted at 66px and then dropped (CLS 0.33);
an inline script after the header sets --nav-height first. Browsers
without ResizeObserver or MediaQueryList.addEventListener fall back
instead of aborting main.js. seo_title now shortens any post's <title>,
not only a paper's. The SVG child names stay as they were: allowed in
prose, they would hide a <marker> placeholder.
…on a quoted marker

A '> ```' line inside a bare ```markdown example ended the block early,
and the lightbox check used a second, different fence pattern.
@bits-bytes-nn
bits-bytes-nn merged commit abaacd8 into main Oct 15, 2026
3 checks passed
@bits-bytes-nn
bits-bytes-nn deleted the review-r9 branch October 15, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant