-
-
Notifications
You must be signed in to change notification settings - Fork 198
feat(theme): add FileTree component #2655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
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-*torp-*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.
| console.log(child.props, 111111); | ||
|
|
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
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.
| console.log(child.props, 111111); |
| const { title: rawTitle } = (child.props as any).children?.props as { | ||
| title?: string; | ||
| }; |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
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.
Summary
feat(theme): add FileTree component
Related Issue
close #2154
Checklist