-
Notifications
You must be signed in to change notification settings - Fork 48
Fix: Checking whether comment can be created #434
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
Merged
harrisoncramer
merged 21 commits into
harrisoncramer:develop
from
jakubbortlik:fix-checking-if-comment-can-be-created
Dec 8, 2024
Merged
Fix: Checking whether comment can be created #434
harrisoncramer
merged 21 commits into
harrisoncramer:develop
from
jakubbortlik:fix-checking-if-comment-can-be-created
Dec 8, 2024
Conversation
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
0611567 to
d3ffd1c
Compare
If `imply_local` is set but unused due to local changes present when review is started, `imply_local` is overridden so that local changes do not unnecessarily block comments. Now, uncommitted changes on a file will only block comments when they are made after the review is started with `imply_local` applied.
The function create_comment_layout should now always return a layout (it used to return nil if the comment could not be created at all).
The check that `diffview_lib.get_current_view() == nil` is superfluous because we later also check explicitly that we are in the reviewer tab.
The position data are not necessary for creating a draft reply and requiring it prevented draft replies in case the discussion tree was open outside of the reviewer pane.
d3ffd1c to
3479bde
Compare
|
This looks great, thank you for the contribution. The refactor and consolidation of the comment checks was needed. |
harrisoncramer
added a commit
that referenced
this pull request
Dec 11, 2024
* Feat: Enable sorting discussions by original comment (#422) * Feat: Improve popup UX (#426) * Feat: Automatically update MR summary details (#427) * Feat: Show update progress in winbar (#432) * Feat: Abbreviate winbar (#439) * Fix: Note Creation Bug (#441) * Fix: Checking whether comment can be created (#434) * Fix: Syntax in discussion tree (#433) * fix: improve indication of resolved threads and drafts (#442) * Docs: Various minor improvements (#445) --------- Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me>
harrisoncramer
added a commit
that referenced
this pull request
Jan 18, 2025
Miscellaneous bug fixes and improvements. docs: various improvements (#445) fix: don't jump to file from reviewer if it doesn't exist (#452) fix: force linewise motion in suggestion keybinding (#454) fix: prevent error after plenary job update (#456) fix: fix JSON on Windows (#458) fix: remove retry logic (#449) fix: check whether comment can be created (#434)
jakubbortlik
pushed a commit
to jakubbortlik/gitlab.nvim
that referenced
this pull request
Jan 27, 2025
Miscellaneous bug fixes and improvements. docs: various improvements (harrisoncramer#445) fix: don't jump to file from reviewer if it doesn't exist (harrisoncramer#452) fix: force linewise motion in suggestion keybinding (harrisoncramer#454) fix: prevent error after plenary job update (harrisoncramer#456) fix: fix JSON on Windows (harrisoncramer#458) fix: remove retry logic (harrisoncramer#449) fix: check whether comment can be created (harrisoncramer#434)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi @harrisoncramer, in this PR I address #424, by making the following changes:
create_comment,create_comment_suggestionandcreate_multiline_commentin a dedicated functiongitlab.actions.comment.can_make_comment().imply_local = trueis overridden in the settings if the working tree is dirty. Before, it was possible that the settingimply_localwas true, while the option was not actually applied to theDiffviewOpencommand and so commenting was unnecessarily blocked for modified files.There are some other improvements:
I'll be grateful if you find the time to review and merge this.