Top toolbar by maoyama · Pull Request #169 · maoyama/Changes (original) (raw)
- Removed old navigation toolbar implementation.
- Added branches button with updated icon.
- Enhanced loading state display with a progress view.
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 updates the top toolbar in FolderView by refactoring how toolbar items are conditionally rendered based on loading state and macOS version. It replaces the navigationToolbar() function with a dedicated branchesButton() and introduces macOS 26 availability checks for certain toolbar items.
- Refactored toolbar item configuration for loading and non-loading states.
- Replaced the navigationToolbar() function with a branchesButton() implementation.
- Added availability checks for macOS 26 to conditionally display progress views and spacer items. Comments suppressed due to low confidence (1)
GitClient/Views/Folder/FolderView.swift:312
- [nitpick] Renaming navigationToolbar to branchesButton may be confusing if the function is expected to handle more than just branch selection. Ensure that the function name accurately reflects its purpose.
fileprivate func branchesButton() -> some View {
| if isLoading { |
|---|
| ProgressView() |
| .scaleEffect(x: 0.5, y: 0.5, anchor: .center) |
| if #available(macOS 26.0, *) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The progress view configuration is duplicated for macOS 26 and the alternative case. Consider extracting the common ProgressView configuration into a helper view to reduce repetition.
Copilot uses AI. Check for mistakes.
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
[ Show hidden characters]({{ revealButtonHref }})