-
Notifications
You must be signed in to change notification settings - Fork 105
feat: Implement online file editor and Diff preview functionality #1598
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
juanlou1217
commented
Oct 29, 2025
- Provide editing and Diff preview modes
- Support file renaming feature
- Fix blame timeline
- Fix lastCommit avatar display
- Provide editing and Diff preview modes - Support file renaming feature - Fix blame timeline - Fix lastCommit avatar display
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 refactors the API types to simplify commit and blame information structures, removing redundant user details in favor of simple usernames, and adds a new blob editing feature with diff preview capabilities.
Key Changes
- Simplified blame and commit information structures by replacing complex user objects with simple username/time fields
- Removed the
UserInfotype and replaced nested objects with string usernames - Added blob editing functionality with a new
BlobEditorcomponent and supporting hooks
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| moon/packages/types/generated.ts | Simplified BlameInfo, CommitBindingResponse, and LatestCommitInfo types; removed UserInfo type |
| moon/apps/web/hooks/useUpdateBlob.ts | New hook for updating blob content with query invalidation |
| moon/apps/web/hooks/useDiffPreview.ts | New hook for generating diff previews |
| moon/apps/web/components/CodeView/CommitHistory.tsx | Updated to use simplified LatestCommitInfo with username strings and fetch member data separately |
| moon/apps/web/components/CodeView/BlobView/CodeContent.tsx | Added edit mode state, BlobEditor integration, and updated blame field references |
| moon/apps/web/components/CodeView/BlobView/BlobEditor.tsx | New component providing inline file editing with diff preview and commit dialog |
| type='text' | ||
| value={editedFileName} | ||
| onChange={(e) => setEditedFileName(e.target.value)} | ||
| placeholder='fileName' |
Copilot
AI
Oct 30, 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.
Placeholder text should use proper spacing: 'File name' instead of 'fileName' for better user experience.
| placeholder='fileName' | |
| placeholder='File name' |
| type='text' | ||
| value={commitMessage} | ||
| onChange={(e) => setCommitMessage(e.target.value)} | ||
| placeholder={`update ${fileName}`} |
Copilot
AI
Oct 30, 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.
Placeholder text should be capitalized: 'Update' instead of 'update' to maintain consistency with the commit message label.
| placeholder={`update ${fileName}`} | |
| placeholder={`Update ${fileName}`} |
Co-authored-by: Copilot <[email protected]> Signed-off-by: 卷娄 <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: 卷娄 <[email protected]>
d9179c8