Skip to content

refactor(theme/EditLink): merge EditLinkRow into EditLink and extract SVG icons#3172

Merged
SoonIter merged 3 commits intomainfrom
syt/fix-edit-link
Mar 2, 2026
Merged

refactor(theme/EditLink): merge EditLinkRow into EditLink and extract SVG icons#3172
SoonIter merged 3 commits intomainfrom
syt/fix-edit-link

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Feb 28, 2026

Summary

  • Merged EditLinkRow and EditLink into a single EditLink component, using isOutline prop to differentiate styles
  • Replaced <a> tags with Link component in EditLink
  • Extracted inline SVG icons from EditLink and ScrollToTop into separate SVG files (edit.svg, scroll-to-top.svg) and registered them as IconEdit / IconScrollToTop in icons.ts
  • Updated documentation for EditLink props and built-in icons (en/zh)

Test plan

  • Verify EditLink renders correctly in DocFooter (default style)
  • Verify EditLink renders correctly in Outline panel (isOutline style with icon)
  • Verify ScrollToTop button renders correctly in Outline panel
  • Verify documentation site builds without errors

Copilot AI review requested due to automatic review settings February 28, 2026 10:24
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 28, 2026

Deploying rspress-v2 with  Cloudflare Pages  Cloudflare Pages

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

View logs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 28, 2026

Rsdoctor Bundle Diff Analysis

Found 3 projects in monorepo, 3 projects with changes.

📊 Quick Summary
Project Total Size Change
node 12.0 MB 📉 -155.5 KB (-1.3%)
node_md 1.5 MB +2.2 KB (0.1%)
web 15.9 MB +3.1 KB (0.0%)
📋 Detailed Reports (Click to expand)

📁 node

Path: website/doc_build/diff-rsdoctor/node/rsdoctor-data.json

📌 Baseline Commit: 160451580a | PR: #3164

Metric Current Baseline Change
📊 Total Size 12.0 MB 12.1 MB -155.5 KB (-1.3%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 12.0 MB 12.1 MB -155.5 KB (-1.3%)
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: node Bundle Diff

📁 node_md

Path: website/doc_build/diff-rsdoctor/node_md/rsdoctor-data.json

📌 Baseline Commit: 160451580a | PR: #3164

Metric Current Baseline Change
📊 Total Size 1.5 MB 1.5 MB +2.2 KB (0.1%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 1.5 MB 1.5 MB +2.2 KB (0.1%)

📦 Download Diff Report: node_md Bundle Diff

📁 web

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

📌 Baseline Commit: 160451580a | PR: #3164

Metric Current Baseline Change
📊 Total Size 15.9 MB 15.9 MB +3.1 KB (0.0%)
📄 JavaScript 15.7 MB 15.7 MB +3.2 KB (0.0%)
🎨 CSS 120.3 KB 120.5 KB -203.0 B (-0.2%)
🌐 HTML 0 B 0 B 0
📁 Other Assets 163.6 KB 163.5 KB +110.0 B (0.1%)

📦 Download Diff Report: web Bundle Diff

Generated by Rsdoctor GitHub Action

Copy link
Copy Markdown
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

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 EditLink via a new isOutline prop and switched EditLink to use the theme Link component.
  • Extracted inline SVGs into edit.svg / scroll-to-top.svg and re-exported them as IconEdit / IconScrollToTop.
  • Updated en/zh docs for EditLink props and the built-in icon list; adjusted default editLinkText strings.

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.

@SoonIter SoonIter requested a review from Timeless0911 March 2, 2026 07:34
@SoonIter SoonIter enabled auto-merge (squash) March 2, 2026 07:34
@SoonIter SoonIter merged commit 66fe9f8 into main Mar 2, 2026
9 checks passed
@SoonIter SoonIter deleted the syt/fix-edit-link branch March 2, 2026 07:36
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.

3 participants