-
Notifications
You must be signed in to change notification settings - Fork 7
Context menu on graph #116
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
- 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.
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 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)
No description provided.