Skip to content

docs: place Copy page control below the title on small screens - #491

Merged
vihar merged 2 commits into
masterfrom
docs/copy-page-mobile
Aug 16, 2026
Merged

docs: place Copy page control below the title on small screens#491
vihar merged 2 commits into
masterfrom
docs/copy-page-mobile

Conversation

@vihar

@vihar vihar commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to #490. On small screens the Copy page control now sits directly below the page heading, left-aligned (in flow, before the first paragraph) instead of above the title. Wide screens are unchanged (same row as the title, right edge of the text column).

How

  • CopyPageMenu.vue — the control is wrapped in a <Teleport>. After mount, and after every client-side page change (onContentUpdated), it inserts a small .copy-page-slot host right after the page <h1> and teleports itself there. Before hydration, or if a page has no H1, it renders in place in the doc-before slot as before. Copy/menu behaviour is unchanged. On <768px the button is left-aligned and the menu anchors to the button's left edge.
  • style.css — placement rules cover both positions: <768px → in-flow block under the H1 (pre-teleport position hidden to avoid a jump on load); ≥768px → identical absolute placement, with the H1 padding reserve via h1:has(+ .copy-page-slot > .copy-page). The .vp-doc a … colour rules exclude .copy-page__item, since the menu links now live inside .vp-doc.

Verified

  • Dev + hydrated pnpm preview build: mobile shows H1 → Copy page → paragraph, menu opens left-anchored, links keep neutral colour; desktop geometry identical to before; SPA navigation moves the control under the new page's H1 and closes the menu; home (copyPage: false) has none; no Vue/Teleport/hydration warnings.
  • pnpm build clean; SSR HTML unchanged apart from the teleport marker; pnpm check:format passes.

Teleport the control to right after the page H1 once mounted (and after
each client-side page change), so it sits directly under the heading,
left-aligned, on narrow screens while staying on the title row on wide
screens. Falls back to the doc-before slot before hydration or when a
page has no H1.

Also keeps the menu links neutral now that they render inside .vp-doc.
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 16, 2026 3:10pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@vihar, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d83dba8e-4697-4102-a373-0185f3482293

📥 Commits

Reviewing files that changed from the base of the PR and between 606a138 and f0a327f.

📒 Files selected for processing (2)
  • docs/.vitepress/theme/components/CopyPageMenu.vue
  • docs/.vitepress/theme/style.css

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The menu now renders inside .vp-doc, where the theme's `.vp-doc a:hover`
would tint the links brand-blue; set the hover colour explicitly.
@vihar
vihar merged commit 4f2fdb1 into master Aug 16, 2026
5 checks passed
@vihar
vihar deleted the docs/copy-page-mobile branch August 16, 2026 16:00
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