Repository navigation
[AR-20261028-3] Put the page description directly after the H1 and drop the hidden MDX copy - #964
Merged
Merged
Conversation
- CustomPageTitle: emit p.page-subtitle right after the H1 and the Copy menu after it, keeping the visual layout via CSS grid areas. Mark the Copy menu container data-nosnippet. - CopyPageButton: drop the hidden page-markdown-content template (a second copy of the raw MDX source in every page's HTML, 325 KB across 21 sampled pages) and its MDX cleanup helpers. Copy page now fetches the page's .md twin on click, via ClipboardItem with a pending Blob promise (keeps Safari's user activation) with a fetch-then-writeText fallback, and shows a Copy failed toast on error. View as Markdown opens the .md URL directly. - Add scripts/validate-page-title-order.mjs (npm run test:page-title-order) and run it in CI after the build.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
This PR was generated with Warp. Comment |
Contributor
Author
|
Preview checks (autoresearch AR-20261028-3)
Posted by a Warp agent |
…y toast to screen readers
Contributor
Author
|
Addressed review findings in the latest commit:
Posted by a Warp agent |
hongyi-chen
approved these changes
Oct 29, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
On every docs page, the raw HTML that follows
</h1>currently holds:<template id="page-markdown-content">carrying the page's entire raw MDX source,On
/factories/the description starts about 17 KB after</h1>. Across 21 sampled pages, 0 of 21 put the description first, and the hidden template adds 325 KB, 202 KB of it on/changelog/2026/alone.This PR changes no prose, and the title row looks the same:
CustomPageTitle.astro: the source order is now H1, thenp.page-subtitle, then the Copy menu (wrapped indata-nosnippet). A CSS grid keeps the Copy button to the right of the H1, with the description spanning the full width underneath.CopyPageButton.astro: the full-page<template>and its MDX cleanup helpers are removed..mdtwin on click, which is the "durable fix" the existing code comment called for. It usesClipboardItemwith a pending blob and falls back to fetch thenwriteText. The toast now reports failures too..mdURL directly.scripts/validate-page-title-order.mjs(npm run test:page-title-order, added to CI after the homepage JSON-LD check) fails the build if any built page:</h1>with the description.Why (AR-20261028-3, weekly AEO autoresearch)
Verification (local production build)
npm ci,npm run typecheck(0 errors),npm run buildand alltest:*scripts pass: heading-vars, heading-tocs (3,392 entries), tracking-redirect, tracking-routes, homepage-json-ld, kapa-webmcp, kapa-support-escalation, and the new page-title-order check across 400 pages./factories.md(200), showed "Copied!", and the pasted text was the page markdown.Risks
.mdis unavailable it shows "Copy failed" instead of copying raw MDX..mdtwin rather than raw MDX: components are rendered and variables resolved, and it starts with the llms.txt note lines.ClipboardItempath is untested.Preview checks follow in a comment.