Skip to content

Conversation

maoyama
Copy link
Owner

@maoyama maoyama commented May 25, 2025

Screenshot 2025-05-25 at 13 01 51

This pull request makes improvements to the CommitDiffView in GitClient/Views/Commit/CommitDiffView.swift to enhance user experience and simplify the code by removing unnecessary parameters. The key changes include adding a "No Changes" message when there are no file differences and refactoring the updateDiff method to remove the cached parameter.

User Experience Improvements:

  • Added a new state variable filesChangesIsEmpty to track whether there are any file changes. If no changes are detected, a "No Changes" message with a Label is displayed in the ScrollView. ([GitClient/Views/Commit/CommitDiffView.swiftR18-R33](https://github.com/maoyama/Tempo/pull/147/files#diff-51f1ff4df91dce0f310e65c2690f4fe206a33ba9f281a6d38eca08caface7cd4R18-R33))
  • Updated the shortstat string to display "No Changes" when it is empty, providing clearer feedback to the user. ([GitClient/Views/Commit/CommitDiffView.swiftL70-R104](https://github.com/maoyama/Tempo/pull/147/files#diff-51f1ff4df91dce0f310e65c2690f4fe206a33ba9f281a6d38eca08caface7cd4L70-R104))

Code Simplifications:

  • Removed the cached parameter from the updateDiff method and its associated calls, simplifying the method signature and logic. ([GitClient/Views/Commit/CommitDiffView.swiftL70-R104](https://github.com/maoyama/Tempo/pull/147/files#diff-51f1ff4df91dce0f310e65c2690f4fe206a33ba9f281a6d38eca08caface7cd4L70-R104))

maoyama added 5 commits May 25, 2025 11:56
This reverts commit 9d495ad.
- Introduced a new state variable `filesChangesIsEmpty` to manage the display of an empty state.
- Added a message indicating 'No Changes' when there are no file changes.
- Updated the shortstat logic to display 'No Changes' when appropriate.
This reverts commit 5af5810.
@maoyama maoyama requested a review from Copilot May 25, 2025 04:06
Copy link
Contributor

@Copilot Copilot AI left a 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 pull request improves the user experience in the CommitDiffView by displaying a "No Changes" message when there are no file differences and simplifies the code by removing the unnecessary cached parameter from the updateDiff method.

  • Added a state variable to track if there are file changes and conditionally display a "No Changes" message.
  • Updated the shortstat string to display "No Changes" when empty.
  • Refactored the updateDiff method to remove the redundant cached parameter.

@maoyama maoyama merged commit 406e583 into main May 25, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant