Skip to content

fix(docs): paint the landing tabs before hydration and clear hydration mismatches - #415

Merged
vite-hub[bot] merged 5 commits into
mainfrom
fix/docs-hydration
Nov 12, 2026
Merged

vite-hub[bot] merged 5 commits into
mainfrom
fix/docs-hydration

Conversation

@onmax

@onmax onmax commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Before it hydrates, the landing paints a black block over "For humans" and "pnpm", and ten pages log "Hydration completed but contains mismatches." I swept all 413 pages in the sitemap with headless Chromium.

  • Landing tabs. Reka positions the tabs' indicator in the browser, so the server's HTML has none. Until then Nuxt UI draws the active pill behind the trigger with its default bg-inverted, and :ui="segmented" only restyled the indicator. The fallback pill now gets the indicator's look.
  • Comments pages (/comments, 7 Doctor pages). @vite-hub/docs marks a suggestion inside a paragraph as inline, but the site's own ComarkHtml.vue ignored that and drew a div, which ends the <p>. It now draws a span, and blockProps no longer lands on the element as "[object Object]". It uses v-if/v-else, since Vue's SSR drops v-html on <component :is>.
  • /cast. An HTML parser drops the newline right after <pre>, so a cast whose screen starts with a blank line lost it on the server and got it back on hydration. comark-cast now writes that first newline in a span.
  • /remark-to-comark/testing. comark-chips turns [comarkdown/comark#525](…) into a chip, and the GitHub references plugin then linked the text inside it, which put a link inside a link. References now skip chip like a.
  • Doctor images. The annotate examples pointed at /pond.png, /pond-before.png and /pond-after.png, and the xref ones at relative files. None of them exist, so 29 pages showed a broken image and logged a 404. They now use a drawn pond.svg, pond-fence.svg, and /dashboard.png. chips/invalid-avatar keeps its 404, since the broken avatar is the point of that example.

The header logo and the GitHub button's 4px move come from @vite-hub/docs, so they're fixed there: vite-hub/vitehub#4151 (logo preload), and the color mode button change in progress in another vitehub PR. The landing canvas is intended: the head script picks the canvas before the first paint, the viewport has a fixed height, and CLS on / is 0.

Before/after: https://drop.vitehub.dev/d/vz1sr4fr261n/before-after

What I ran:

  • pnpm docs:generate (with the vitehub DocsBrandMark.vue and color mode button changes copied into node_modules), then e2e/serve.ts and the same Chromium sweep over all 413 URLs. Production: 10 pages with mismatches, and 85 failed requests to the site itself on 38 pages. This branch: 0 mismatches, and 20 failed requests on 9 pages: the media examples (/pond-tour.mp4, /spinner.mp4, /roof.mp3), the three /census*.png on annotate/too-many-annotations, and chips/invalid-avatar.
  • With /_nuxt/*.js blocked, the hero tabs show the raised pill in light and dark. The only pixels that still change on hydration are the person and robot icons. My local prerender timed out on Nuxt Icon's 1.5 s fetch for them, and production's HTML has them.
  • vp test run test/doctor.test.ts packages/cast/test packages/github/test packages/ui/test/ui.test.ts: 363 passed. The new cast and ui tests fail on main.
  • pnpm typecheck passes. pnpm --filter comark-ui-docs typecheck fails on landing.stars because my local landing.ts got no star count from GitHub. I didn't touch that code.
  • vp lint and vp fmt --check on the changed files pass. I didn't run the full pnpm ready.

Not checked: Safari and Firefox, and the media and census examples, which still need real files.

Prepared with Claude Opus 5.5 in T3 Code.

Reka positions the tabs' indicator in the browser, so the server's HTML has none. Until then Nuxt UI draws a pill
behind the active trigger with the color's default, bg-inverted, which made a black block over "For humans" and
"pnpm" until the app hydrated. That pill now gets the indicator's look.
@vite-hub/docs marks an HTML-only block inside a paragraph, such as a comments suggestion, as inline. The site's own
ComarkHtml ignored that and drew a div, which ends the paragraph in the server's HTML, so the comments pages logged a
hydration mismatch. It also wrote blockProps as a "[object Object]" attribute.
An HTML parser drops a newline right after <pre>. A cast whose screen starts with a blank line lost it in server
HTML and got it back once Vue hydrated, which /cast logged as a mismatch. The first newline now goes in a span.
comark-chips turns a link into a chip, which draws as a link. The references plugin then linked
`comarkdown/comark#525` inside it, a link inside a link, which the HTML parser splits. /remark-to-comark/testing
logged a hydration mismatch from it.
The annotate examples pointed at /pond.png, /pond-before.png, and /pond-after.png, and the xref ones at relative
files, none of which exist, so their previews showed broken images and 404s. They now use a drawn pond (pond.svg),
the same pond with a fence (pond-fence.svg), and the dashboard image. chips/invalid-avatar keeps its 404, which is
the point of that example.
@pullfrog

pullfrog Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The workflow's Verify CLIProxy completion step failed, so Pullfrog never ran. That step runs before Pullfrog in this repo's workflow, so the fix is in the workflow or that step's own setup.

GitHub's error
Process completed with exit code 22.

View the step's logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-12T12:22:01.142323Z
We couldn’t complete this review. Comment @codex review to try again.
193d55f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@415

comark-badge

pnpm add https://pkg.pr.new/comark-badge@415

comark-cards

pnpm add https://pkg.pr.new/comark-cards@415

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@415

comark-cast

pnpm add https://pkg.pr.new/comark-cast@415

comark-charts

pnpm add https://pkg.pr.new/comark-charts@415

comark-chat

pnpm add https://pkg.pr.new/comark-chat@415

comark-chips

pnpm add https://pkg.pr.new/comark-chips@415

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@415

comark-code

pnpm add https://pkg.pr.new/comark-code@415

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@415

comark-colors

pnpm add https://pkg.pr.new/comark-colors@415

comark-comments

pnpm add https://pkg.pr.new/comark-comments@415

comark-critic

pnpm add https://pkg.pr.new/comark-critic@415

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@415

comark-details

pnpm add https://pkg.pr.new/comark-details@415

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@415

comark-diff

pnpm add https://pkg.pr.new/comark-diff@415

comark-embed

pnpm add https://pkg.pr.new/comark-embed@415

comark-fields

pnpm add https://pkg.pr.new/comark-fields@415

comark-figure

pnpm add https://pkg.pr.new/comark-figure@415

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@415

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@415

comark-github

pnpm add https://pkg.pr.new/comark-github@415

comark-icon

pnpm add https://pkg.pr.new/comark-icon@415

comark-include

pnpm add https://pkg.pr.new/comark-include@415

comark-keys

pnpm add https://pkg.pr.new/comark-keys@415

comark-links

pnpm add https://pkg.pr.new/comark-links@415

comark-linter

pnpm add https://pkg.pr.new/comark-linter@415

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@415

comark-mark

pnpm add https://pkg.pr.new/comark-mark@415

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@415

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@415

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@415

comark-media

pnpm add https://pkg.pr.new/comark-media@415

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@415

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@415

comark-outline

pnpm add https://pkg.pr.new/comark-outline@415

comark-properties

pnpm add https://pkg.pr.new/comark-properties@415

comark-qr

pnpm add https://pkg.pr.new/comark-qr@415

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@415

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@415

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@415

comark-sources

pnpm add https://pkg.pr.new/comark-sources@415

comark-steps

pnpm add https://pkg.pr.new/comark-steps@415

comark-table

pnpm add https://pkg.pr.new/comark-table@415

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@415

comark-tests

pnpm add https://pkg.pr.new/comark-tests@415

comark-time

pnpm add https://pkg.pr.new/comark-time@415

comark-ui

pnpm add https://pkg.pr.new/comark-ui@415

comark-xref

pnpm add https://pkg.pr.new/comark-xref@415

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@415

commit: 193d55f

@vite-hub
vite-hub Bot merged commit a0eadf3 into main Nov 12, 2026
5 of 6 checks passed
@vite-hub
vite-hub Bot deleted the fix/docs-hydration branch November 12, 2026 13:11
@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
@vite-hub

vite-hub Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
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