Skip to content

Conversation

@SoonIter
Copy link
Member

Summary

fix(theme): plugin-preview should hide the toc

image

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 24, 2025 03:36
@netlify
Copy link

netlify bot commented Nov 24, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit f593ba1
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/692420b447aa10000819232e
😎 Deploy Preview https://deploy-preview-2803--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the table of contents (TOC) visibility issue in the plugin-preview theme by hiding the outline when a preview device is displayed. The changes simplify the previous implementation that dynamically adjusted padding based on window width, replacing it with a simpler approach that directly hides the TOC outline element.

Key changes:

  • Removed dynamic padding logic that adjusted based on window size
  • Added inline style to hide the TOC outline when preview device is shown
  • Renamed CSS classes from unprefixed (e.g., fixed-device) to rp- prefixed (e.g., rp-fixed-device) for consistency
  • Improved test fixture documentation structure with proper headings

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/plugin-preview/static/global-components/Device.tsx Simplified outline hiding logic by removing useWindowSize/useEffect hooks and adding inline style to hide TOC; updated class names to use rp- prefix
packages/plugin-preview/static/global-components/Device.css Updated CSS class names from unprefixed to rp- prefixed for consistency
packages/plugin-preview/static/global-components/DemoBlock.tsx Updated class names from rspress-demo-block to rp-demo-block for consistency
packages/plugin-preview/static/global-components/DemoBlock.css Updated CSS class names to match the new rp- prefixed naming convention
e2e/fixtures/plugin-preview/doc/mixed.mdx Added proper heading structure to test fixture
e2e/fixtures/plugin-preview/doc/index.mdx Added h2 heading to improve test fixture structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2025

Rsdoctor Bundle Diff Analysis

📁 web

Path: website/doc_build/web/rsdoctor-data.json

📌 Baseline Commit: 84e750d076 | PR: #2804

Metric Current Baseline Change
📊 Total Size 14.4 MB 14.4 MB 0 B (0.0%)
📄 JavaScript 13.8 MB 13.8 MB 0 B (0.0%)
🎨 CSS 109.9 KB 109.9 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 496.9 KB 496.9 KB 0 B (0.0%)

📦 Download Diff Report: web Bundle Diff

Generated by Rsdoctor GitHub Action

Timeless0911
Timeless0911 previously approved these changes Nov 24, 2025
@SoonIter SoonIter merged commit f1cf3fd into main Nov 24, 2025
9 checks passed
@SoonIter SoonIter deleted the syt/fix-preview-style branch November 24, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants