Skip to content

Commit

Permalink
feat: Support replies
Browse files Browse the repository at this point in the history
Support replies to comments inside patches / issues and in inline comments

Signed-off-by: stelios maurommatakis <steliosmavr@cytech.gr>
  • Loading branch information
Stelios123 committed Apr 30, 2024
1 parent 2f8e730 commit 08577f5
Show file tree
Hide file tree
Showing 13 changed files with 367 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.intellij.openapi.util.text.HtmlBuilder;
import com.intellij.openapi.util.text.HtmlChunk;
import com.intellij.ui.ColorUtil;
import com.intellij.openapi.project.Project;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.components.panels.Wrapper;
import com.intellij.util.ui.JBFont;
Expand All @@ -21,6 +22,7 @@
import network.radicle.jetbrains.radiclejetbrainsplugin.RadicleBundle;
import network.radicle.jetbrains.radiclejetbrainsplugin.icons.RadicleIcons;
import network.radicle.jetbrains.radiclejetbrainsplugin.issues.overview.editor.IssueVirtualFile;
import network.radicle.jetbrains.radiclejetbrainsplugin.models.Embed;
import network.radicle.jetbrains.radiclejetbrainsplugin.models.Emoji;
import network.radicle.jetbrains.radiclejetbrainsplugin.models.RadAuthor;
import network.radicle.jetbrains.radiclejetbrainsplugin.models.RadDetails;
Expand All @@ -32,6 +34,7 @@
import network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.DragAndDropField;
import network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.EmojiPanel;
import network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.MarkDownEditorPaneFactory;
import network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.ReplyPanel;
import network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.Utils;

import javax.swing.JComponent;
Expand All @@ -55,6 +58,7 @@ public class IssueComponent {
private JPanel emojiJPanel;
private EmojiPanel<RadIssue> emojiPanel;
private final IssueVirtualFile file;
private JComponent replyPanel;

public IssueComponent(IssueVirtualFile file) {
this.file = file;
Expand Down Expand Up @@ -110,19 +114,22 @@ public JComponent createCommentSection(List<RadDiscussion> discussionList) {
var message = com.body;
if (!Strings.isNullOrEmpty(com.replyTo) && !com.replyTo.equals(issueId)) {
var replyToMessage = findMessage(com.replyTo, discussionList);
message = "<div><div style=\"border-left: 2px solid black;\">" +
" <div style=\"margin-left:10px\">" + replyToMessage + "</div>\n" +
"</div><div style=\"margin-top:5px\">" + message + "</div></div>";
message = Utils.formatReplyMessage(message, replyToMessage);
}
var panel = new BorderLayoutPanel();
panel.setOpaque(false);
var editorPane = new MarkDownEditorPaneFactory(message, radIssue.project, radIssue.projectId, file);
panel.addToCenter(StatusMessageComponentFactory.INSTANCE.create(editorPane.htmlEditorPane(), StatusMessageType.WARNING));

Check warning on line 122 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.timeline.StatusMessageComponentFactory' is declared in unstable package 'com.intellij.collaboration.ui.codereview.timeline' marked with @ApiStatus.Experimental

Check warning on line 122 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'WARNING' is declared in unstable package 'com.intellij.collaboration.ui.codereview.timeline' marked with @ApiStatus.Experimental

Check warning on line 122 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.timeline.StatusMessageType' is declared in unstable package 'com.intellij.collaboration.ui.codereview.timeline' marked with @ApiStatus.Experimental

Check warning on line 122 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'create(javax.swing.JComponent, com.intellij.collaboration.ui.codereview.timeline.StatusMessageType)' is declared in unstable package 'com.intellij.collaboration.ui.codereview.timeline' marked with @ApiStatus.Experimental

Check warning on line 122 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'INSTANCE' is declared in unstable package 'com.intellij.collaboration.ui.codereview.timeline' marked with @ApiStatus.Experimental

Check warning on line 122 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.timeline.StatusMessageComponentFactory' is declared in unstable package 'com.intellij.collaboration.ui.codereview.timeline' marked with @ApiStatus.Experimental
emojiPanel = new IssueEmojiPanel(issueModel, com.reactions, com.id, radDetails);
var verticalPanel = getVerticalPanel(5);
verticalPanel.setOpaque(false);
emojiJPanel = emojiPanel.getEmojiPanel();
panel.addToBottom(emojiJPanel);
verticalPanel.add(emojiJPanel);
replyPanel = new MyReplyPanel(radIssue.project, com, issueModel).getThreadActionsComponent();
verticalPanel.add(replyPanel);
panel.addToBottom(verticalPanel);
var panelHandle = new EditablePanelHandler.PanelBuilder(radIssue.project, panel,
RadicleBundle.message("save"), new SingleValueModel<>(message), (field) -> {
RadicleBundle.message("save"), new SingleValueModel<>(com.body), (field) -> {

Check warning on line 132 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 132 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 132 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 132 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
var edited = api.editIssueComment(radIssue, field.getText(), com.id, field.getEmbedList());
final boolean success = edited != null;
if (success) {
Expand Down Expand Up @@ -229,6 +236,24 @@ public JComponent getCommentSection() {
return commentSection;
}

public JComponent getReplyPanel() {
return replyPanel;
}

public class MyReplyPanel extends ReplyPanel<RadIssue> {

public MyReplyPanel(Project project, RadDiscussion radDiscussion,
SingleValueModel<RadIssue> model) {

Check warning on line 246 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
super(project, radDiscussion, model);
}

@Override
public boolean addReply(String comment, List<Embed> embedList, String replyToId) {
var res = api.addIssueComment(radIssue, comment, replyToId, embedList);
return res != null;
}
}

public class IssueEmojiPanel extends EmojiPanel<RadIssue> {
protected IssueEmojiPanel(SingleValueModel<RadIssue> model, List<Reaction> reactions, String discussionId, RadDetails radDetails) {

Check warning on line 258 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 258 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/issues/overview/IssueComponent.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
super(model, reactions, discussionId, radDetails);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package network.radicle.jetbrains.radiclejetbrainsplugin.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Strings;

import java.time.Instant;
import java.util.HashMap;
Expand Down Expand Up @@ -36,6 +37,10 @@ public boolean isReviewComment() {
return location != null;
}

public boolean isReply() {
return !Strings.isNullOrEmpty(replyTo);
}

public Reaction findReaction(String emojiUnicode) {
return reactions.stream().filter(r -> r.emoji().equals(emojiUnicode)).findFirst().orElse(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.Set;

public class RadPatch {
Expand Down Expand Up @@ -186,6 +187,12 @@ public List<Review> getReviews() {
return myReviews;
}

public List<RadDiscussion> getReviewComments(String filePath, String commitHash) {
return discussions.stream().filter(disc -> disc.isReviewComment() &&
disc.location.path.equals(filePath) && disc.location.commit.equals(commitHash))
.collect(Collectors.toList());
}

public RadDiscussion findDiscussion(String commentId) {
return discussions().stream().filter(disc -> disc.id.equals(commentId)).findFirst().orElse(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.intellij.util.EventDispatcher;
import com.intellij.util.ui.EDT;
import git4idea.GitUtil;
import network.radicle.jetbrains.radiclejetbrainsplugin.models.RadDiscussion;
import network.radicle.jetbrains.radiclejetbrainsplugin.models.RadPatch;
import network.radicle.jetbrains.radiclejetbrainsplugin.models.ThreadModel;
import network.radicle.jetbrains.radiclejetbrainsplugin.services.RadicleProjectApi;
Expand All @@ -22,6 +23,7 @@
import java.util.ArrayList;
import java.util.EventListener;
import java.util.List;
import java.util.Optional;

public class ObservableThreadModel {
private static final Logger logger = LoggerFactory.getLogger(ObservableThreadModel.class);
Expand Down Expand Up @@ -82,20 +84,47 @@ private List<LineRange> calculateModifiedLines() {
}

public List<ThreadModel> getInlineComments(RadPatch patch) {
var lastRevision = patch.revisions.get(patch.revisions.size() - 1);
var discussions = lastRevision.discussions().stream().filter(discussion -> discussion.isReviewComment() &&
(discussion.location.path.equals(getFilePath()) && discussion.location.commit.equals(getCommitHash()))).toList();
var lastRevision = patch.getLatestRevision();
var reviewComments = lastRevision.getReviewComments(getFilePath(), getCommitHash());
var groupedDiscussions = new ArrayList<ThreadModel>();
for (var discussion : discussions) {
var line = discussion.location.start;
if (isCommentInModifiedLine(line)) {
var threadModel = new ThreadModel(line, discussion);
groupedDiscussions.add(threadModel);
for (var disc : reviewComments) {
var line = disc.location.start;
if (!isCommentInModifiedLine(line)) {
continue;
}
if (!disc.isReply()) {
addNewThread(groupedDiscussions, disc);
} else {
addToExistingThread(groupedDiscussions, disc);
}
}
return groupedDiscussions;
}

private void addNewThread(List<ThreadModel> groupedDiscussions, RadDiscussion discussion) {
var newThreadModel = new ThreadModel(discussion.location.start, discussion);
groupedDiscussions.add(newThreadModel);
}

private void addToExistingThread(List<ThreadModel> groupedDiscussions, RadDiscussion discussion) {
var existingThreadModel = findThreadModel(groupedDiscussions, discussion);
if (existingThreadModel.isPresent()) {
var threadModel = existingThreadModel.get();
threadModel.addRadDiscussion(discussion);
} else {
addNewThread(groupedDiscussions, discussion);
}
}

private Optional<ThreadModel> findThreadModel(List<ThreadModel> groupedDiscussions, RadDiscussion discussion) {
return groupedDiscussions.stream()
.filter(threadModel -> threadModel.getRadDiscussion()
.stream()
.anyMatch(radDiscussion -> radDiscussion.id.equals(discussion.replyTo)))
.findFirst();
}


private void updateEditorCommentsUi(RadPatch patch) {
var fetched = this.api.fetchPatch(patch.radProject.id, patch.repo, patch.id);
boolean success = fetched != null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package network.radicle.jetbrains.radiclejetbrainsplugin.patches.review;

import com.google.common.base.Strings;
import com.google.protobuf.Any;
import com.intellij.collaboration.ui.CollaborationToolsUIUtilKt;
import com.intellij.collaboration.ui.SingleValueModel;
import com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil;
import com.intellij.collaboration.ui.codereview.ToggleableContainer;
import com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil;
import com.intellij.collaboration.ui.codereview.timeline.thread.TimelineThreadCommentsPanel;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.text.HtmlBuilder;
import com.intellij.openapi.util.text.HtmlChunk;
import com.intellij.ui.CollectionListModel;
import com.intellij.ui.ColorUtil;
import com.intellij.ui.components.labels.LinkLabel;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import kotlin.Unit;
Expand All @@ -23,9 +26,11 @@
import network.radicle.jetbrains.radiclejetbrainsplugin.services.RadicleProjectApi;
import network.radicle.jetbrains.radiclejetbrainsplugin.services.RadicleProjectService;
import network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.MarkDownEditorPaneFactory;
import network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.Utils;

import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.List;
Expand Down Expand Up @@ -55,6 +60,7 @@ public JComponent createThread(ThreadModel threadModel) {
}
var commentsPanel = new TimelineThreadCommentsPanel<>(listModel, this::createComponent, 0, 10);
verticalPanel.add(commentsPanel);
verticalPanel.add(getThreadActionsComponent(threadModel));
verticalPanel.setBorder(JBUI.Borders.empty(CodeReviewChatItemUIUtil.ComponentType.COMPACT.getInputPaddingInsets()));

Check warning on line 64 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getInputPaddingInsets()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 64 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 64 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 64 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'COMPACT' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 64 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getInputPaddingInsets()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 64 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 64 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
return CodeReviewCommentUIUtil.INSTANCE.createEditorInlayPanel(verticalPanel);

Check warning on line 65 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 65 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'createEditorInlayPanel(javax.swing.JComponent)' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 65 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'INSTANCE' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 65 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 65 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'createEditorInlayPanel(javax.swing.JComponent)' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 65 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'INSTANCE' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental
}
Expand All @@ -65,6 +71,50 @@ public boolean deleteComment(RadDiscussion disc) {
return res != null;
}

public JComponent createUncollapsedThreadActionsComponent(ThreadModel threadModel) {
var panelHandle = new EditablePanelHandler.PanelBuilder(patch.project, new JPanel(),
RadicleBundle.message("reply", "Reply"),
new SingleValueModel<>(""), (field) -> {

Check warning on line 77 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 77 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 77 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 77 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
var line = Integer.valueOf(threadModel.getLine());
var latestRev = threadModel.getRadDiscussion().get(threadModel.getRadDiscussion().size() - 1);
var location = new RadDiscussion.Location(threadsModel.getFilePath(), "ranges",
threadsModel.getCommitHash(), line, line);
var res = this.api.addPatchComment(patch, field.getText(), latestRev.id, location, field.getEmbedList());
boolean success = res != null;
if (success) {
threadsModel.update(patch);
}
return success;
}).enableDragAndDrop(false).hideCancelAction(true).build();
panelHandle.showAndFocusEditor();
var builder = new CodeReviewChatItemUIUtil.Builder(CodeReviewChatItemUIUtil.ComponentType.COMPACT, integer ->

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'COMPACT' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.Builder' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'Builder(com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType, kotlin.jvm.functions.Function1\>, javax.swing.JComponent)' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'COMPACT' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 90 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
new SingleValueModel<>(RadicleIcons.DEFAULT_AVATAR), panelHandle.panel);

Check warning on line 91 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 91 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 91 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 91 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
return builder.build();

Check warning on line 92 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'build()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 92 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'build()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
}

public JComponent createCollapsedThreadActionComponent(ReplyAction replyAct) {
var reply = new LinkLabel<Any>(RadicleBundle.message("reply", "Reply"), null) {
@Override
public void doClick() {
replyAct.reply();
}
};
var horizontalPanel = CollaborationToolsUIUtilKt.HorizontalListPanel(CodeReviewCommentUIUtil.Actions.HORIZONTAL_GAP);

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'HorizontalListPanel(int)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil.Actions' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.CollaborationToolsUIUtilKt' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'HORIZONTAL_GAP' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'HorizontalListPanel(int)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil.Actions' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental
horizontalPanel.setBorder(JBUI.Borders.emptyLeft(CodeReviewChatItemUIUtil.ComponentType.COMPACT.getContentLeftShift() + 12));

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getContentLeftShift()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'COMPACT' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getContentLeftShift()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 103 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'COMPACT' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
horizontalPanel.add(reply);
return horizontalPanel;
}

public JComponent getThreadActionsComponent(ThreadModel myThreadsModel) {
var toggleModel = new SingleValueModel<>(false);

Check warning on line 109 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 109 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 109 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 109 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
return ToggleableContainer.INSTANCE.create(toggleModel, () -> {

Check warning on line 110 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'create(com.intellij.collaboration.ui.SingleValueModel, kotlin.jvm.functions.Function0, kotlin.jvm.functions.Function0)' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 110 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.ToggleableContainer' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 110 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'INSTANCE' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 110 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'create(com.intellij.collaboration.ui.SingleValueModel, kotlin.jvm.functions.Function0, kotlin.jvm.functions.Function0)' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
ReplyAction rep = () -> {
toggleModel.setValue(true);

Check warning on line 112 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'setValue(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 112 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'setValue(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
};
return createCollapsedThreadActionComponent(rep);
}, () -> createUncollapsedThreadActionsComponent(myThreadsModel));
}

private JComponent createComponent(RadDiscussion disc) {
var editorPane = new MarkDownEditorPaneFactory(disc.body, patch.project, patch.radProject.id, patch.repo.getRoot());
var panelHandle = new EditablePanelHandler.PanelBuilder(patch.project, editorPane.htmlEditorPane(),
Expand Down Expand Up @@ -100,7 +150,7 @@ private JComponent createComponent(RadDiscussion disc) {
}
var builder = new CodeReviewChatItemUIUtil.Builder(CodeReviewChatItemUIUtil.ComponentType.COMPACT, integer ->

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'COMPACT' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.Builder' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'Builder(com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType, kotlin.jvm.functions.Function1\>, javax.swing.JComponent)' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 151 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
new SingleValueModel<>(RadicleIcons.DEFAULT_AVATAR), panelHandle.panel);

Check warning on line 152 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 152 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
var author = !Strings.isNullOrEmpty(disc.author.alias) ? disc.author.alias : disc.author.id;
var author = !Strings.isNullOrEmpty(disc.author.alias) ? disc.author.alias : Utils.formatDid(disc.author.id);
var authorLink = HtmlChunk.link("#",
author).wrapWith(HtmlChunk.font(ColorUtil.toHtmlColor(UIUtil.getLabelForeground()))).bold();
var titleText = new HtmlBuilder().append(authorLink)
Expand All @@ -109,4 +159,8 @@ private JComponent createComponent(RadDiscussion disc) {
builder.withHeader(new JLabel(MarkDownEditorPaneFactory.wrapHtml(titleText.toString())), actionsPanel);

Check warning on line 159 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'withHeader(javax.swing.JComponent, javax.swing.JComponent)' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
return builder.build();

Check warning on line 160 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'build()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 160 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/review/PatchReviewThreadComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'build()' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
}

public interface ReplyAction {
void reply();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class EditablePanelHandler {
private final boolean allowDragAndDrop;
private DragAndDropField dragAndDropField;
private SingleValueModel<Boolean> isLoading = new SingleValueModel<>(false);

Check warning on line 42 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/EditablePanelHandler.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Field may be 'final'

Field `isLoading` may be 'final'

Check warning on line 42 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/EditablePanelHandler.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 42 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/EditablePanelHandler.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 42 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/EditablePanelHandler.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 42 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/EditablePanelHandler.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Field may be 'final'

Field `isLoading` may be 'final'

Check warning on line 42 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/EditablePanelHandler.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.SingleValueModel' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental

Check warning on line 42 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/EditablePanelHandler.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'SingleValueModel(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
private OnCloseListener onCloseListener;

public EditablePanelHandler(PanelBuilder builder) {
this.closeEditorAfterSubmit = builder.closeEditorAfterSubmit;
Expand Down Expand Up @@ -142,6 +143,17 @@ public void hideEditor() {
panel.revalidate();
panel.repaint();
editor = null;
if (onCloseListener != null) {
onCloseListener.onClose();
}
}

public interface OnCloseListener {
void onClose();
}

public void addOnCloseListener(OnCloseListener myListener) {
onCloseListener = myListener;
}

public static class PanelBuilder {
Expand Down

0 comments on commit 08577f5

Please sign in to comment.