Skip to content

refactor(theme/llms-placement): move LLMs components to Llms directory and support outline placement#3180

Merged
SoonIter merged 1 commit intomainfrom
syt/svg-polish
Mar 2, 2026
Merged

refactor(theme/llms-placement): move LLMs components to Llms directory and support outline placement#3180
SoonIter merged 1 commit intomainfrom
syt/svg-polish

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Mar 2, 2026

Summary

  • Move LlmsCopyRow and LlmsOpenRow from Outline/ to Llms/ directory for better code organization
  • Support LLMs UI placement in the Outline sidebar via llmsUI.placement config
  • Move open-in-wrapper styles to dedicated LlmsOpenRow.scss
  • Nest EditLink styles under .rp-doc-footer scope and add distinct class names to action rows

Related Issues

#3164

#3170

#3163

Test plan

  • Verify LLMs copy/open buttons render correctly in outline when llmsUI.placement === 'outline'
  • Verify EditLink still works in both outline and doc footer contexts
  • Verify ScrollToTop button still functions correctly
  • Verify build passes (npx nx build @rspress/core)

Copilot AI review requested due to automatic review settings March 2, 2026 09:43
…utline placement

- Move LlmsCopyRow and LlmsOpenRow from Outline/ to Llms/ directory
- Export LlmsCopyRow and LlmsOpenRow from theme index
- Add LLMs UI support in Outline component with placement config
- Move open-in-wrapper styles to dedicated LlmsOpenRow.scss
- Nest EditLink styles under .rp-doc-footer scope
- Add distinct class names to EditLink and ScrollToTop action rows
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

Rsdoctor Bundle Diff Analysis

Found 3 projects in monorepo, 2 projects with changes.

📊 Quick Summary
Project Total Size Change
node 12.0 MB +1.7 KB (0.0%)
web 15.9 MB +4.9 KB (0.0%)
node_md 1.5 MB 0
📋 Detailed Reports (Click to expand)

📁 node

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

📌 Baseline Commit: dd83352c3d | PR: #3179

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

📦 Download Diff Report: node Bundle Diff

📁 web

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

📌 Baseline Commit: dd83352c3d | PR: #3179

Metric Current Baseline Change
📊 Total Size 15.9 MB 15.9 MB +4.9 KB (0.0%)
📄 JavaScript 15.7 MB 15.7 MB +4.9 KB (0.0%)
🎨 CSS 120.3 KB 120.3 KB +30.0 B (0.0%)
🌐 HTML 0 B 0 B 0
📁 Other Assets 163.6 KB 163.6 KB 0

📦 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

This PR refactors the theme’s LLM-related UI by relocating outline-specific LLM action rows into the Llms/ component directory and adds support for rendering those actions in the Outline sidebar based on themeConfig.llmsUI.placement.

Changes:

  • Export LlmsCopyRow / LlmsOpenRow from the theme entry and render them in Outline when llmsUI.placement === 'outline'.
  • Move “open-in-wrapper” positioning styles into a dedicated LlmsOpenRow.scss.
  • Scope EditLink styling under .rp-doc-footer and add distinct class names to some action rows.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/theme/index.ts Re-exports LlmsCopyRow / LlmsOpenRow so Outline can import them via @theme.
packages/core/src/theme/components/Outline/index.tsx Adds llmsUI.placement handling and conditionally renders LLM rows in the outline bottom area.
packages/core/src/theme/components/Outline/index.scss Removes the open-in-wrapper style block from Outline styles.
packages/core/src/theme/components/Outline/ScrollToTop.tsx Adds a dedicated rp-scroll-to-top class to the action row.
packages/core/src/theme/components/Llms/LlmsOpenRow.tsx Updates imports and pulls styling into LlmsOpenRow.scss.
packages/core/src/theme/components/Llms/LlmsOpenRow.scss New stylesheet for outline menu positioning.
packages/core/src/theme/components/Llms/LlmsCopyRow.tsx Updates imports to use @theme and local useMdUrl.
packages/core/src/theme/components/EditLink/index.tsx Adds rp-edit-link class to the outline variant.
packages/core/src/theme/components/EditLink/index.scss Scopes .rp-edit-link styling under .rp-doc-footer.
packages/core/src/theme/assets/success.svg Updates the success icon SVG (viewBox/path).
packages/core/src/theme/assets/copy.svg Updates the copy icon SVG (viewBox/path).
Comments suppressed due to low confidence (2)

packages/core/src/theme/components/Llms/LlmsOpenRow.tsx:6

  • LlmsOpenRow is now re-exported from the theme barrel (packages/core/src/theme/index.ts) but also imports SvgWrapper from @theme (the same barrel). This increases the chance of circular-dependency ordering issues and makes the module graph harder to reason about. Prefer importing SvgWrapper via a relative path (as LlmsViewOptions does) to avoid the self-referential barrel import.
    packages/core/src/theme/components/Llms/LlmsCopyRow.tsx:4
  • LlmsCopyRow is now re-exported from the theme barrel (packages/core/src/theme/index.ts) but imports SvgWrapper from @theme (the same barrel). To reduce circular-barrel coupling, import SvgWrapper directly from ../SvgWrapper (or the local component path) instead of the barrel.

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

@SoonIter SoonIter requested a review from Timeless0911 March 2, 2026 09:59
@SoonIter SoonIter enabled auto-merge (squash) March 2, 2026 09:59
@SoonIter SoonIter changed the title refactor(theme): move LLMs components to Llms directory and support outline placement refactor(theme/llms-placement): move LLMs components to Llms directory and support outline placement Mar 2, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 2, 2026

Deploying rspress-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0696fae
Status: ✅  Deploy successful!
Preview URL: https://7c67256b.rspress-v2.pages.dev
Branch Preview URL: https://syt-svg-polish.rspress-v2.pages.dev

View logs

@SoonIter SoonIter merged commit 4d01488 into main Mar 2, 2026
7 checks passed
@SoonIter SoonIter deleted the syt/svg-polish branch March 2, 2026 10:25
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