Skip to content

Conversation

maoyama
Copy link
Owner

@maoyama maoyama commented May 1, 2025

No description provided.

maoyama added 7 commits May 1, 2025 08:51
- Moved context menu handling from CommitLogView to a new method `commitContextMenu` in View extension.
- Improved code readability and reusability by separating context menu logic.
- Added bindings for `showing` and `isRefresh` to `CommitGraphView`.
- Updated `CommitGraphContentView` to accommodate new bindings and updated context menu.
- Adjusted layout and preview configurations accordingly to integrate new features.
- Integrated a context menu for commits in the commit graph view, allowing users to perform actions related to the selected commit.
- Passed necessary parameters such as folder, commit, logStore, isRefresh, showing, and bindingError to the context menu.
…utes

- Removed commented-out preview code and replaced it with active previews
- Introduced state variables for managing selection log ID, log store, visibility, and refresh status
- Updated sample commits for better structure and clarity in previews
- Structured previews for consistent styling and functionality across different contexts.
@maoyama maoyama requested a review from Copilot May 1, 2025 14:00
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 PR refactors the context menu functionality on commits, unifying the implementation across the commit log and graph views. Key changes include:

  • Adding new bindings (showing, isRefresh) to support the refactored context menus.
  • Removing the redundant showGraph binding from CommitLogView.
  • Extracting the common context menu logic into a new commitContextMenu extension on View.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
GitClient/Views/Folder/FolderView.swift Updated view bindings to pass new parameters to context menu modifiers.
GitClient/Views/Folder/CommitLogView.swift Removed unused showGraph binding and updated context menu usage.
GitClient/Views/Folder/CommitGraph.swift Updated context menu invocations in graph view and previews.
GitClient/Views/Extensions/View+.swift Introduced the commitContextMenu extension to consolidate menu logic.
Comments suppressed due to low confidence (2)

GitClient/Views/Folder/CommitGraph.swift:147

  • Consider avoiding force unwrapping of 'folder' (folder!) to prevent potential runtime crashes. It might be beneficial to safely unwrap the variable or assert its presence before use.
.commitContextMenu(folder: folder!, commit: commit.commit, logStore: logStore, isRefresh: $isRefresh, showing: $showing, bindingError: $error)

GitClient/Views/Folder/CommitGraph.swift:163

  • The duplicate invocation of commitContextMenu on both the GraphNode and GraphNodeText views may lead to overlapping context menu behavior. Consider consolidating these modifiers if only a single context interaction is intended.
.commitContextMenu(folder: folder!, commit: commit.commit, logStore: logStore, isRefresh: $isRefresh, showing: $showing, bindingError: $error)

@maoyama maoyama merged commit 569873d into main May 1, 2025
4 checks passed
@maoyama
Copy link
Owner Author

maoyama commented May 1, 2025

#76

@maoyama maoyama deleted the context-menu-on-graph branch May 1, 2025 14:31
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