fix(theme): plugin-preview should hide the toc#2803
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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) torp-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.
Rsdoctor Bundle Diff Analysis📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
39d8bde to
f593ba1
Compare
Summary
fix(theme): plugin-preview should hide the toc
Related Issue
Checklist