-
Notifications
You must be signed in to change notification settings - Fork 16
refactor: 创建文件树组件,更新文档 #38
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
Conversation
以下文件中的文件树已更新为新组件: - first.md - configuration.md - fix.md - client-distribution.md - what-is-datapack.md - server-dir-structure.md (purpur) - server-dir-structure.md (bds) - server-file-structure.md - levilamina-plugins.md
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 introduces a new reusable FileTree component to replace hardcoded file tree representations across the documentation. The component provides an interactive, collapsible file tree visualization with support for comments, descriptions, and custom icons.
Key Changes:
- Created a new
FileTreeReact component with TypeScript support that parses indented text into an interactive tree structure - Added CSS module styling with dark mode support for the tree component
- Migrated 9 documentation files from plain text file trees to the new component
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/FileTree/index.tsx | New FileTree component with parsing logic, collapsible nodes, and description support |
| src/components/FileTree/styles.module.css | Styling for the file tree with dark mode support and interactive states |
| docs/advance/viaproxy/configuration.md | Updated to use FileTree component |
| docs/advance/management/player-management/client-distribution.md | Updated to use FileTree component |
| docs-java/start/basic/what-is-datapack.md | Updated to use FileTree component with extensive nested structure |
| docs-java/start/basic/server-dir-structure.md | Updated to use FileTree component with descriptions object for detailed file information |
| docs-java/process/plugin/more/plugin-build/first.md | Updated Maven and Gradle project structures to use FileTree component |
| docs-java/process/mobile-player/geyser/upgrade/extended/fix.md | Updated to use FileTree component |
| docs-bedrock/nukkit/start/basic/server-file-structure.md | Updated to use FileTree component |
| docs-bedrock/bds/start/basic/server-dir-structure.md | Updated to use FileTree component |
| docs-bedrock/bds/process/levilamina/levilamina-plugins.md | Updated to use FileTree component |
Comments suppressed due to low confidence (2)
src/components/FileTree/index.tsx:9
- Unused import FolderOpenOutlined.
import {
FolderOpenOutlined,
FolderOutlined,
FileOutlined,
FileTextOutlined,
InfoCircleOutlined,
} from "@ant-design/icons";
src/components/FileTree/index.tsx:175
- Unused variable selectedNode.
const [selectedNode, setSelectedNode] = useState<FileNode | null>(null);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
主要变更: 1. 样式重构:移除 CSS Modules,迁移至 Tailwind CSS,优化深色模式适配。 2. 交互优化:引入 View Transitions API 支持平滑动画,添加独立的折叠/展开按钮。 3. 逻辑改进: - 优化图标判断逻辑,无后缀文件默认显示为文件图标。 - 支持显式文件夹标记,名称后添加 '/' 即可强制识别为文件夹。 4. 文档更新:更新了相关文档中的文件树示例,适配新的语法。 使用教程: - 文件夹标记:在名称后添加 '/' (如 'logs/') 可强制显示为文件夹图标并高亮。 - 自动描述:超过 30 个字符的注释会自动转换为下方的详细描述块。 - 图标识别:自动识别常见文件扩展名和特定文件名 (如 Dockerfile, Makefile)。
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
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/components/FileTree/index.tsx:1
- In line 89 of first.md,
messagesis marked as a folder (should end with/), but in line 118 it's also marked as a folder without the/suffix. This inconsistency in the documentation examples could confuse users about whethermessagesis a file or folder. Ensure consistent use of trailing slashes for folders in all examples.
import React, { useState, useMemo, useCallback } from "react";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


以下九个文件中的文件树已更新为新组件: