Add page scrolling, display README files, and show commit history.#1138
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the repository browser by enabling vertical scrolling, replacing manual README fetch with a blob hook, and adding a commit history panel.
- Allow page content to scroll instead of being clipped
- Fetch and render README.md via
useGetBlobin both tree and root views - Introduce
CommitHistoryandCommitDetailscomponents with expandable UI
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| moon/apps/web/pages/_app.tsx | Commented out unused diff-view stylesheet import |
| moon/apps/web/pages/[org]/code/tree/[...path]/index.tsx | Switched overflow-hidden → overflow-auto, used blob hook, added commit history stub |
| moon/apps/web/components/CodeView/index.tsx | Simplified README fetch using useGetBlob |
| moon/apps/web/components/CodeView/TreeView/RepoTree.tsx | Adjusted tree item label font size inline |
| moon/apps/web/components/CodeView/TreeView/CloneTabs.tsx | Switched to LEGACY_API_URL, removed endpoint use, path replace hardcoded org |
| moon/apps/web/components/CodeView/CommitHistory.tsx | Added expandable commit details logic |
| moon/apps/web/components/CodeView/CommitDetails.tsx | New placeholder component for commit details |
| moon/apps/web/components/CodeView/CodeTable.tsx | Replaced CSS module with inline styles for markdown |
Comments suppressed due to low confidence (2)
moon/apps/web/components/CodeView/CommitHistory.tsx:26
- [nitpick] The
flagprop name is vague—consider renaming it to something more descriptive (e.g.,viewMode) or adding a comment explaining its permitted values.
export default function CommitHistory({ flag, info }: {flag:string, info: CommitInfo }) {
moon/apps/web/components/CodeView/CommitDetails.tsx:7
- This placeholder component has repetitive static lines. Add a TODO or implement actual commit detail fields to avoid shipping stub content.
CommitDetails <br/>
| import 'styles/prose.css' | ||
| import '@radix-ui/themes/styles.css' | ||
| import '@git-diff-view/react/styles/diff-view.css'; | ||
| // import '@git-diff-view/react/styles/diff-view.css'; |
There was a problem hiding this comment.
Remove this commented-out import entirely or add a comment explaining why it’s disabled to avoid dead code clutter.
| // import '@git-diff-view/react/styles/diff-view.css'; | |
| // import '@git-diff-view/react/styles/diff-view.css'; // Disabled because the diff-view feature is not currently in use. Remove this line if the feature is deprecated. |
| useEffect(() => { | ||
| if (endpoint) { | ||
| const url = new URL(endpoint) | ||
| if (LEGACY_API_URL) { |
There was a problem hiding this comment.
The path replacement is hardcoded to '/myorganization/code/tree/'. Consider deriving the org and repo dynamically from route params to support multiple orgs.
| import { CheckIcon, CopyIcon, DownloadIcon } from '@gitmono/ui/Icons' | ||
| import {LEGACY_API_URL} from '@gitmono/config' | ||
|
|
||
| const CloneTabs = ({ endpoint }: any) => { |
There was a problem hiding this comment.
The endpoint prop is no longer used inside this component but still appears in the signature and effect deps—please remove it to clean up unused parameters.
| const CloneTabs = ({ endpoint }: any) => { | |
| const CloneTabs = () => { |
| let real_path = pathname?.replace('/tree', '') | ||
|
|
||
| const markdownContentStyle = { | ||
| margin:' 0 auto', |
There was a problem hiding this comment.
[nitpick] There’s an extra space before the zero in margin:' 0 auto'. Also consider moving repeated inline styles into a shared CSS or styled component for consistency.
No description provided.