refactor(theme/EditLink): merge EditLinkRow into EditLink and extract SVG icons#3172
refactor(theme/EditLink): merge EditLinkRow into EditLink and extract SVG icons#3172
Conversation
Deploying rspress-v2 with
|
| Latest commit: |
209cda6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c5d37137.rspress-v2.pages.dev |
| Branch Preview URL: | https://syt-fix-edit-link.rspress-v2.pages.dev |
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 nodePath:
📦 Download Diff Report: node Bundle Diff 📁 node_mdPath:
📦 Download Diff Report: node_md Bundle Diff 📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
There was a problem hiding this comment.
Pull request overview
Refactors the theme’s “Edit this page” and outline actions by consolidating EditLink variants into a single component and standardizing icon usage via extracted SVG assets, with accompanying documentation updates.
Changes:
- Merged outline EditLink row into
EditLinkvia a newisOutlineprop and switched EditLink to use the themeLinkcomponent. - Extracted inline SVGs into
edit.svg/scroll-to-top.svgand re-exported them asIconEdit/IconScrollToTop. - Updated en/zh docs for EditLink props and the built-in icon list; adjusted default
editLinkTextstrings.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/ui/layout-components/edit-link.mdx | Documents new isOutline prop. |
| website/docs/zh/ui/icons/index.mdx | Adds IconEdit / IconScrollToTop to built-in icon list. |
| website/docs/en/ui/layout-components/edit-link.mdx | Documents new isOutline prop. |
| website/docs/en/ui/icons/index.mdx | Adds IconEdit / IconScrollToTop to built-in icon list. |
| packages/core/src/theme/icons.ts | Registers new SVG assets as IconEdit / IconScrollToTop. |
| packages/core/src/theme/components/Outline/index.tsx | Uses EditLink isOutline instead of EditLinkRow. |
| packages/core/src/theme/components/Outline/ScrollToTop.tsx | Replaces inline SVG with SvgWrapper + IconScrollToTop; aligns styling with action-row. |
| packages/core/src/theme/components/Outline/ScrollToTop.scss | Removes now-redundant ScrollToTop-specific styles. |
| packages/core/src/theme/components/Outline/EditLinkRow.tsx | Deletes old outline-only EditLinkRow component. |
| packages/core/src/theme/components/EditLink/index.tsx | Adds isOutline rendering mode and uses Link + extracted edit icon. |
| packages/core/src/theme/assets/scroll-to-top.svg | Adds extracted scroll-to-top icon asset. |
| packages/core/src/theme/assets/edit.svg | Adds extracted edit icon asset. |
| packages/core/src/node/runtimeModule/DEFAULT_I18N_TEXT.ts | Removes 📝 emoji from default editLinkText translations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
EditLinkRowandEditLinkinto a singleEditLinkcomponent, usingisOutlineprop to differentiate styles<a>tags withLinkcomponent inEditLinkEditLinkandScrollToTopinto separate SVG files (edit.svg,scroll-to-top.svg) and registered them asIconEdit/IconScrollToTopinicons.tsTest plan