feat: enhance UI with file statistics and changes preview #7
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.
Description
This PR enhances the user interface of the commit message generator by adding comprehensive file statistics and a visual preview of changes. The improvements provide users with clear, colorful feedback about their Git repository state before generating commit messages.
Type of Change
Related Issue
Fixes #(issue number)
Changes Made
UI Enhancements
File Statistics Display: Added a comprehensive changes summary showing:
Visual Changes Preview: Implemented a table-based preview showing:
Enhanced Header: Added a full-width styled header "🚀 Commit Message Generator"
Improved Commit Message Display:
Better Spinner Feedback:
Code Improvements
New Data Structure: Added
FileStatisticsstruct to track:Helper Functions:
getFileStatistics(): Collects comprehensive file statistics from GitdisplayFileStatistics(): Renders file stats with pterm stylingdisplayCommitMessage(): Shows commit message in a styled paneldisplayChangesPreview(): Displays line change statisticsfilterEmpty(): Utility to clean up file listsImport Organization: Reordered imports for better code organization
Dependency Updates
github.com/openai/openai-go/v3 v3.0.1to support ChatGPT integrationgo.modandgo.sumwith new dependencies and reordered entriesTesting
Test Scenarios Verified
Checklist
Screenshots (if applicable)
Before
After
Additional Notes
Technical Details
ptermlibrary extensively for styled terminal outputFuture Enhancements
Breaking Changes
None. This is a pure UI enhancement that doesn't change any existing functionality or API.
For Hacktoberfest Participants
Thank you for your contribution! 🎉