-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix: Checking whether comment can be created #434
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 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
jakubbortlik
force-pushed
the
fix-checking-if-comment-can-be-created
branch
from
December 6, 2024 14:15
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.
jakubbortlik
force-pushed
the
fix-checking-if-comment-can-be-created
branch
from
December 8, 2024 13:57
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 <[email protected]>
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_suggestion
andcreate_multiline_comment
in a dedicated functiongitlab.actions.comment.can_make_comment()
.imply_local = true
is overridden in the settings if the working tree is dirty. Before, it was possible that the settingimply_local
was true, while the option was not actually applied to theDiffviewOpen
command 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.