Skip to content

Conversation

@SoonIter
Copy link
Member

@SoonIter SoonIter commented Oct 14, 2025

Summary

feat(theme): add FileTree component

Related Issue

close #2154

Checklist

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

Copilot AI review requested due to automatic review settings October 14, 2025 16:34
@netlify
Copy link

netlify bot commented Oct 14, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 351aff6
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/68ee7b94b268330008ee6df7
😎 Deploy Preview https://deploy-preview-2655--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 adds a new FileTree component to the theme-default package and refactors code block styling to use consistent class naming patterns. The FileTree component provides a file explorer interface for displaying multiple code files with navigation.

  • Adds a new FileTree component that displays code files in a tree structure with file navigation
  • Refactors code block CSS class names from rspress-* to rp-* for consistency
  • Updates Shiki configuration to remove language class addition and use a custom transformer

Reviewed Changes

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

Show a summary per file
File Description
packages/theme-default/src/components/FileTree/index.tsx New FileTree component implementation with tree building and file navigation logic
packages/theme-default/src/components/FileTree/index.scss Styling for the FileTree component including responsive design
packages/theme-default/src/index.ts Exports the new FileTree component and its props interface
packages/core/src/node/mdx/rehypePlugins/transformers/add-lang.ts New Shiki transformer to add language attributes to pre elements
Multiple files Updates CSS class names from rspress-* to rp-* pattern for consistency
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +84 to +85
console.log(child.props, 111111);

Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Debug console.log statement should be removed before production deployment.

Suggested change
console.log(child.props, 111111);

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
const { title: rawTitle } = (child.props as any).children?.props as {
title?: string;
};
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Using 'any' type bypasses type safety. Consider defining proper TypeScript interfaces for the expected child props structure.

Copilot uses AI. Check for mistakes.
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.

[Feature][RuntimeComponent]: Support <Files />

2 participants