Skip to content

Make the HTML theme work on phones, and give it some life - #3

Merged
fb55 merged 5 commits into
mainfrom
theme
Nov 21, 2026
Merged

fb55 merged 5 commits into
mainfrom
theme

Conversation

@fb55

@fb55 fb55 commented Nov 21, 2026

Copy link
Copy Markdown
Owner

The HTML theme didn't deal well with smaller screens: on a phone the site navigation sat at the very bottom of the page with no menu, "On this page" was hidden below desktop width, and parameter descriptions could be squeezed into a one-character column. It also read as very bare.

Now the navigation is a menu drawer on phones and a sticky sidebar from 60rem, and "On this page" stays in reach under the header as you read (a side panel at laptop width, a column on wide screens). Signatures are larger and wrap with a hanging indent, examples scroll instead of breaking words, parameters sit over their descriptions, and headings look the same on every page. A few small touches add some life: pages change in place where browsers support view transitions, the member a link lands on glows briefly, kinds are marked in the colors their names have in code, and links, rails and dialogs respond softly. All movement respects reduced motion; Firefox and Safari fall back to plain navigation.

It also fixes three rendering bugs the review turned up: type parameters' constraints lost their closing > (R extends ArrayLike<T), summaries gained a space before inline code (function .), and members inherited from dependencies linked to node_modules paths that don't exist in the repository.

Checked on the cheerio, domhandler and parse5 docs: no page overflows horizontally at 320, 375 or 1024px, in light and dark.

Council review

Rounds: 7

Delegate Round 1 Round 2 Round 3 Round 4 Round 5 Round 6 Round 7
GPT-6.2 Astra 6.5/10 8/10 8.8/10 9.0/10 9.1/10 9.1/10 9.2/10
Mythos 5.2 6/10 8/10 8.5/10 8.7/10 9.0/10 9.1/10 9.2/10
Gemini 4 Neon 5/10 7.5/10 8.5/10 8.6/10 8.9/10 8.9/10 9.2/10

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

fb55 and others added 2 commits November 21, 2026 09:56
The theme had no navigation on small screens, signatures were its smallest
text, and headings changed style from page to page. Reviewed over seven
rounds by three models against the best documentation sites.

Also fixes type parameters' constraints losing their closing bracket,
stray spaces around inline code in summaries, and source links into
dependencies' node_modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 09:56
@claude

claude Bot commented Nov 21, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unrestricted same-origin prerendering can trigger credentialed requests to authored URLs before a click, and the ArrowDown handler can interrupt input-method composition.

2 open issues
What changed in this PR

Redesigns the generated HTML documentation theme for smaller screens, improves navigation and readability, and fixes several rendering issues.

Changes:

  • Adds a mobile navigation drawer, responsive page outlines, and layouts that accommodate long signatures and descriptions.
  • Introduces keyboard navigation for search, syntax-based colors, and motion effects with reduced-motion handling.
  • Fixes type-parameter constraints, inline summary spacing, and source links for installed dependencies.
File Description
test/​source.test.ts Tests suppression of installed-dependency source links.
test/​render.test.ts Updates markup expectations and adds rendering regression tests.
test/​fixtures/​rendering.ts Adds fixtures for generic constraints, returns, and inline code.
src/​source.ts Prevents repository links to installed dependencies.
src/​render/​types.ts Separates intrinsic tokens and adds individual type-parameter printing.
src/​render/​html.ts Generates responsive navigation, revised member markup, and rendering fixes.
src/​convert.ts Makes dependency source labels package-relative.
CHANGELOG.md Documents the theme redesign and rendering fixes.
assets/​style.css Implements responsive layouts, typography, colors, and motion effects.
assets/​main.js Adds search keyboard controls and responsive navigation behavior.

Review effort: Balanced

Comment thread src/render/html.ts Resolved
Comment thread assets/main.js Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 10:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The root-hosted prefetch rule can trigger credentialed requests to unrelated application routes on hover, while long index names and source filenames can cause horizontal overflow on mobile.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Allow source labels to shrink and wrap on mobile

assets/​style.css:748

The source label is now a flex item in .member-header, but unlike .member-name it retains the automatic min-content minimum width. A source filename with a long unbroken segment can therefore exceed the phone viewport: inherited overflow-wrap: break-word does not reduce that minimum, and flex-wrap only moves the oversized item onto another line. Add min-width: 0 here so the label can shrink and wrap instead of creating horizontal page overflow.

Medium severity Prevent long index names from widening the mobile grid

assets/​style.css:853

Below the 36rem container breakpoint, this grid has an implicit auto column whose minimum is its items' min-content width. Index names are rendered without <wbr> in sectionIndex, and the new overflow-wrap: break-word does not reduce their min-content width. An identifier wider than a phone's content area therefore widens the grid and causes horizontal overflow instead of wrapping. Give the stacked grid a minmax(0, 1fr) column; the existing container rule can still replace it with two columns.

2 resolved since last review

Review effort: Balanced

Comment thread assets/main.js Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The broad code a selector can prerender authored raw HTML links such as /logout with credentials on hover, so destinations need to be restricted to generated page URLs.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Restrict prerendering to generated page links

assets/​main.js:154

The new code a selector also matches authored raw HTML preserved by the renderer (src/render/html.ts:187,488), not just generated type links. When docs are hosted at /, hovering an authored <code><a href="/logout">Log out</a></code> can therefore trigger a credentialed prerender request before a click. Restrict destinations to the router's actual generated page URLs rather than inferring them from CSS selectors.

1 resolved since last review

Review effort: Balanced

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to evaluate the risk of credentialed prerendering to same-origin pages outside the documentation build before a user clicks a link.

No open issues 🎉

Review effort: Balanced

@fb55
fb55 merged commit 627ac21 into main Nov 21, 2026
12 checks passed
@fb55
fb55 deleted the theme branch November 21, 2026 10:20
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.

2 participants