feat(UI): enhance CodeContent with line copy functionality and toolbar#1100
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the code viewer with a new toolbar (Raw, Copy, Download, Edit), per-line selection and copy functionality, and refines styling for both the code pane and breadcrumb.
- Refactor Layout styles in
BlobPage, passingpathtoCodeContent. - Introduce a toolbar and single-line copy in
CodeContent. - Tweak breadcrumb padding and separator spacing.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| moon/apps/web/pages/[org]/code/blob/[...path].tsx | Updated layout styles; passed path prop into CodeContent. |
| moon/apps/web/components/CodeView/TreeView/BreadCrumb.tsx | Adjusted container padding and removed horizontal margin around /. |
| moon/apps/web/components/CodeView/BlobView/CodeContent.tsx | Added toolbar (Raw/Copy/Download/Edit), line highlighting/copy, and updated component signature. |
| moon/apps/web/components/CodeView/BlobView/CodeContent.module.css | Refined toolbar/button styles and code line number spacing. |
Comments suppressed due to low confidence (3)
moon/apps/web/components/CodeView/BlobView/CodeContent.tsx:187
- [nitpick] The inner
iinline.map(i => i.content)shadows the outer loop index. Rename it to a more descriptive name liketokento avoid confusion.
handleCopyLine(line.map(i=>i.content).join(''))
moon/apps/web/pages/[org]/code/blob/[...path].tsx:82
- You removed the
style={breadStyle}prop from the breadcrumb<Layout>, which breaks its intended sizing and background. Restore or replace the style to maintain the original look.
<Layout>
moon/apps/web/components/CodeView/TreeView/BreadCrumb.tsx:29
- [nitpick] Removing the
mx-1class eliminates spacing around the separator. Consider re-adding horizontal margin to keep consistent breadcrumb spacing.
<span className="text-gray-400">/</span>
benjamin-747
approved these changes
Jun 6, 2025
Collaborator
|
link #1093 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1071
修改样式,完善工具栏,添加源码查看和下载,行高亮,复制代码功能