Skip to content

Commit

Permalink
fix: show multiple lines in patch/issue description when editing
Browse files Browse the repository at this point in the history
  • Loading branch information
JChrist committed Jan 17, 2025
1 parent c10d2c5 commit 3b3c6f1
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private JComponent infoComponent() {
borderPanel.add(projectSelect, BorderLayout.NORTH);
borderPanel.add(titleField, BorderLayout.CENTER);

descriptionField = new DragAndDropField(project, 0, false);
descriptionField = new DragAndDropField(project, 0, false, false);
descriptionField.setBackground(UIUtil.getListBackground());
descriptionField.setFont(JBFont.label());
descriptionField.getComponent().setBorder(JBUI.Borders.empty(8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private JComponent getHeader() {
issueModel.setValue(edited);

Check warning on line 206 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

'setValue(T)' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
}
return success;
}).enableDragAndDrop(false).build();
}).enableDragAndDrop(false).oneLine(true).build();
var contentPanel = panelHandle.panel;
var b = new CodeReviewChatItemUIUtil.Builder(CodeReviewChatItemUIUtil.ComponentType.FULL,

Check warning on line 211 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

'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 211 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.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 211 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.CodeReviewChatItemUIUtil.ComponentType' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 211 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

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

Check warning on line 211 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.CodeReviewChatItemUIUtil.Builder' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental

Check warning on line 211 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.CodeReviewChatItemUIUtil' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
i -> new SingleValueModel<>(RadicleIcons.DEFAULT_AVATAR), contentPanel);

Check warning on line 212 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 212 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class EditablePanelHandler {
private final boolean hideCancelAction;
private final boolean closeEditorAfterSubmit;
private final boolean allowDragAndDrop;
private final boolean oneLine;
private DragAndDropField dragAndDropField;
private SingleValueModel<Boolean> isLoading = new SingleValueModel<>(false);

Check warning on line 43 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 43 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 43 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 43 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
private OnCloseListener onCloseListener;
Expand All @@ -48,6 +49,7 @@ public EditablePanelHandler(PanelBuilder builder) {
this.allowDragAndDrop = builder.allowDragAndDrop;
this.project = builder.project;
this.paneComponent = builder.paneComponent;
this.oneLine = builder.oneLine;
this.editorPaneLayout = SizeRestrictedSingleComponentLayout.Companion.constant(null, null);

Check warning on line 53 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.layout.SizeRestrictedSingleComponentLayout' is declared in unstable package 'com.intellij.collaboration.ui.layout' marked with @ApiStatus.Experimental

Check warning on line 53 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

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

Check warning on line 53 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

'constant(java.lang.Integer, java.lang.Integer)' is declared in unstable package 'com.intellij.collaboration.ui.layout' marked with @ApiStatus.Experimental
this.panel = new JPanel(null);
this.panel.setOpaque(false);
Expand Down Expand Up @@ -81,7 +83,7 @@ public void showAndFocusEditor() {
hideEditor();
return null;
});
dragAndDropField = new DragAndDropField(project, this.allowDragAndDrop);
dragAndDropField = new DragAndDropField(project, this.allowDragAndDrop, this.oneLine);
dragAndDropField.setText(content.getValue());

Check warning on line 87 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

'getValue()' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
//CollaborationToolsUIUtil.installValidator(textField, model.errorValue.map { it?.localizedMessage })
//var inputField = wrapWithProgressOverlay(textField, model.isBusyValue);
Expand Down Expand Up @@ -165,6 +167,7 @@ public static class PanelBuilder {
private boolean hideCancelAction = false;
private boolean closeEditorAfterSubmit = true;
private boolean allowDragAndDrop = true;
private boolean oneLine = false;

public PanelBuilder(Project project, JComponent paneComponent, String actionName,
SingleValueModel<String> content, Function<DragAndDropField, Boolean> okAction) {

Check warning on line 173 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
Expand All @@ -190,6 +193,11 @@ public PanelBuilder closeEditorAfterSubmit(boolean close) {
return this;
}

public PanelBuilder oneLine(boolean one) {
this.oneLine = one;
return this;
}

public EditablePanelHandler build() {
return new EditablePanelHandler(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private EditablePanelHandler getCommentField() {
RadicleBundle.message("patch.comment"), new SingleValueModel<>(""),

Check warning on line 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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
this::createComment)
.hideCancelAction(true)
.enableDragAndDrop(false)
.enableDragAndDrop(true)
.closeEditorAfterSubmit(false)
.build();
panelHandle.showAndFocusEditor();
Expand Down Expand Up @@ -134,7 +134,7 @@ private JComponent getHeader() {
radPatchModel.setValue(edited);

Check warning on line 134 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 success;
}).enableDragAndDrop(false).build();
}).enableDragAndDrop(false).oneLine(true).build();
var contentPanel = panelHandle.panel;
var actionsPanel = CollaborationToolsUIUtilKt.HorizontalListPanel(CodeReviewCommentUIUtil.Actions.HORIZONTAL_GAP);

Check warning on line 139 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 139 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 139 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 139 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 139 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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
actionsPanel.add(CodeReviewCommentUIUtil.INSTANCE.createEditButton(e -> {

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

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'createEditButton(kotlin.jvm.functions.Function1)' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental

Check warning on line 140 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 140 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponent.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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
import java.util.List;
import java.util.concurrent.CountDownLatch;

import static network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.Utils.getHorizontalPanel;
import static network.radicle.jetbrains.radiclejetbrainsplugin.toolwindow.Utils.getVerticalPanel;

public class TimelineComponentFactory {
private static final String PATTERN_FORMAT = "dd/MM/yyyy HH:mm";
private static final DateTimeFormatter DATE_TIME_FORMATTER =
Expand Down Expand Up @@ -96,7 +93,7 @@ public JComponent createDescSection() {
}

public JComponent createTimeline() {
mainPanel = getVerticalPanel(0);
mainPanel = Utils.getVerticalPanel(0);
var loadingIcon = new JLabel(new AnimatedIcon.Default());
mainPanel.add(loadingIcon);
ApplicationManager.getApplication().executeOnPooledThread(() -> {
Expand Down Expand Up @@ -141,23 +138,23 @@ private String findMessage(String replyTo) {
}

private JComponent createRevisionComponent(RadPatch.Revision rev) {
var contentPanel = getVerticalPanel(4);
var contentPanel = Utils.getVerticalPanel(4);
contentPanel.setOpaque(false);
var horizontalPanel = getHorizontalPanel(8);
var horizontalPanel = Utils.getHorizontalPanel(8);
horizontalPanel.setOpaque(false);
var revAuthor = rev.author().generateLabelText(cli);
return createTimeLineItem(contentPanel, horizontalPanel, RadicleBundle.message("revisionPublish", rev.id(), revAuthor), rev.timestamp());
}

private JComponent createReviewComponent(RadPatch.Review review) {
var reviewPanel = getVerticalPanel(0);
var reviewPanel = Utils.getVerticalPanel(0);
var textHtmlEditor = new BaseHtmlEditorPane();

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

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'BaseHtmlEditorPane()' 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/timeline/TimelineComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.BaseHtmlEditorPane' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
textHtmlEditor.setOpaque(false);
var message = Strings.nullToEmpty(review.summary());
var panel = new BorderLayoutPanel();
panel.setOpaque(false);
var editorPane = new MarkDownEditorPaneFactory(message, patch.project, patch.radProject.id, file);
var myPanel = getVerticalPanel(1);
var myPanel = Utils.getVerticalPanel(1);
myPanel.setOpaque(false);
myPanel.add(editorPane.htmlEditorPane());
var verdictMsg = review.verdict() == RadPatch.Review.Verdict.ACCEPT ? RadicleBundle.message("approved") : RadicleBundle.message("requestChanges");
Expand All @@ -175,7 +172,7 @@ private JComponent createReviewComponent(RadPatch.Review review) {
}

private JComponent createCommentComponent(RadDiscussion com) {
var myMainPanel = getVerticalPanel(0);
var myMainPanel = Utils.getVerticalPanel(0);
var textHtmlEditor = new BaseHtmlEditorPane();

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

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

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

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

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.codereview.BaseHtmlEditorPane' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
textHtmlEditor.setOpaque(false);
var message = com.body;
Expand All @@ -188,15 +185,15 @@ private JComponent createCommentComponent(RadDiscussion com) {
var editorPane = new MarkDownEditorPaneFactory(message, patch.project, patch.radProject.id, file);
panel.addToCenter(StatusMessageComponentFactory.INSTANCE.create(editorPane.htmlEditorPane(), StatusMessageType.WARNING));

Check warning on line 186 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 186 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 186 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 186 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 186 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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
emojiPanel = new PatchEmojiPanel(patchModel, com.reactions, com.id, radDetails);
var verticalPanel = getVerticalPanel(5);
var verticalPanel = Utils.getVerticalPanel(5);
verticalPanel.setOpaque(false);
emojiJPanel = emojiPanel.getEmojiPanel();
verticalPanel.add(emojiJPanel);
replyPanel = new MyReplyPanel(patch.project, com, patchModel).getThreadActionsComponent();
verticalPanel.add(replyPanel);
panel.addToBottom(verticalPanel);
if (com.isReviewComment()) {
var infoPanel = getHorizontalPanel(0);
var infoPanel = Utils.getHorizontalPanel(0);
infoPanel.setOpaque(false);
var msg = RadicleBundle.message("comment.on", com.location.path, com.location.start);
if (!patch.isDiscussionBelongedToLatestRevision(com)) {
Expand All @@ -217,7 +214,7 @@ private JComponent createCommentComponent(RadDiscussion com) {
var contentPanel = panelHandle.panel;
var actionsPanel = CollaborationToolsUIUtilKt.HorizontalListPanel(CodeReviewCommentUIUtil.Actions.HORIZONTAL_GAP);

Check warning on line 215 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 215 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 215 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 215 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 215 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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
var self = cli.getCurrentIdentity();
if (self != null && com.author.id.contains(self.nodeId)) {
if (self != null && com.author != null && com.author.contains(self.nodeId)) {
final var editButton = CodeReviewCommentUIUtil.INSTANCE.createEditButton(e -> {

Check warning on line 218 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 218 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.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 218 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/patches/timeline/TimelineComponentFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'createEditButton(kotlin.jvm.functions.Function1)' is declared in unstable package 'com.intellij.collaboration.ui.codereview.comment' marked with @ApiStatus.Experimental
panelHandle.showAndFocusEditor();
return null;
Expand All @@ -235,7 +232,7 @@ private JComponent createCommentComponent(RadDiscussion com) {
actionsPanel.add(editButton);
actionsPanel.add(deleteButton);
}
commentPanel = createTimeLineItem(contentPanel, actionsPanel, com.author.generateLabelText(cli), com.timestamp);
commentPanel = createTimeLineItem(contentPanel, actionsPanel, com.author == null ? "" : com.author.generateLabelText(cli), com.timestamp);
myMainPanel.add(commentPanel);
myMainPanel.setName(JPANEL_PREFIX_NAME + com.id);
return myMainPanel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,23 @@ public class DragAndDropField extends EditorTextField {
private static final Logger logger = LoggerFactory.getLogger(DragAndDropField.class);
private int border = 0;
private final boolean enableDragAndDrop;
private final boolean oneLine;
private final FileService fileService;
private final Project project;
private List<Embed> embedList;

public DragAndDropField(Project project, boolean allowDragAndDrop) {
public DragAndDropField(Project project, boolean allowDragAndDrop, boolean oneLine) {
this.enableDragAndDrop = allowDragAndDrop;
this.oneLine = oneLine;
this.fileService = project.getService(FileService.class);
this.embedList = new ArrayList<>();
this.project = project;
this.putClientProperty(UIUtil.HIDE_EDITOR_FROM_DATA_CONTEXT_PROPERTY, true);

Check failure on line 51 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/DragAndDropField.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Usage of API marked for removal

'HIDE_EDITOR_FROM_DATA_CONTEXT_PROPERTY' is deprecated and marked for removal
this.addDocumentListener(new MyListener(this));
}

public DragAndDropField(Project project, int border, boolean allowDragAndDrop) {
this(project, allowDragAndDrop);
public DragAndDropField(Project project, int border, boolean allowDragAndDrop, boolean oneLine) {
this(project, allowDragAndDrop, oneLine);
this.border = border;
}

Expand All @@ -60,7 +62,7 @@ public DragAndDropField(Project project, int border, boolean allowDragAndDrop) {
var editor = super.createEditor();
editor.getSettings().setUseSoftWraps(true);
editor.setBorder(JBUI.Borders.empty(border));
editor.setOneLineMode(false);
editor.setOneLineMode(oneLine);
editor.setVerticalScrollbarVisible(true);
editor.getComponent().setOpaque(false);
editor.getScrollPane().setOpaque(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public MarkDownEditorPaneFactory(String content, Project project, String radProj
public JEditorPane htmlEditorPane() {
var textPane = new JTextPane();
var editorKit = new HTMLEditorKitBuilder();
editorKit.withViewFactoryExtensions(ExtendableHTMLViewFactory.Extensions.WORD_WRAP, HtmlEditorPaneUtil.INSTANCE.getCONTENT_TOOLTIP(),
editorKit.withViewFactoryExtensions(ExtendableHTMLViewFactory.Extensions.WORD_WRAP, ExtendableHTMLViewFactory.Extensions.FIT_TO_WIDTH_IMAGES,
HtmlEditorPaneUtil.INSTANCE.getCONTENT_TOOLTIP(),

Check warning on line 60 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

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

Check warning on line 60 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

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

Check warning on line 60 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.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' marked with @ApiStatus.Experimental
HtmlEditorPaneUtil.INSTANCE.getINLINE_ICON_EXTENSION(),

Check warning on line 61 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Deprecated API usage

'getINLINE_ICON_EXTENSION()' is deprecated

Check warning on line 61 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.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' marked with @ApiStatus.Experimental

Check warning on line 61 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

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

Check warning on line 61 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getINLINE_ICON_EXTENSION()' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
HtmlEditorPaneUtil.INSTANCE.getIMAGES_EXTENSION());

Check warning on line 62 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.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' marked with @ApiStatus.Experimental

Check warning on line 62 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

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

Check warning on line 62 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/MarkDownEditorPaneFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'com.intellij.collaboration.ui.HtmlEditorPaneUtil' is declared in unstable package 'com.intellij.collaboration.ui' marked with @ApiStatus.Experimental
editorKit.withStyleSheet(StyleSheetUtil.getDefaultStyleSheet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ public static String formatReplyMessage(String message, String replyMessage) {

public static JPanel descriptionPanel(
MarkDownEditorPaneFactory editorPane, Project project, String changeTitle, Function<DragAndDropField, Boolean> editAction) {
var panelHandle = new EditablePanelHandler.PanelBuilder(project, editorPane.htmlEditorPane(),
RadicleBundle.message(changeTitle),
new SingleValueModel<>(editorPane.getRawContent()), editAction).build();
var panel = Utils.getVerticalPanel(1);
panel.add(editorPane.htmlEditorPane());
var panelHandle = new EditablePanelHandler.PanelBuilder(project, panel, RadicleBundle.message(changeTitle),
new SingleValueModel<>(editorPane.getRawContent()), editAction).oneLine(false).enableDragAndDrop(false).build();

Check warning on line 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 102 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 contentPanel = panelHandle.panel;
var b = new CodeReviewChatItemUIUtil.Builder(CodeReviewChatItemUIUtil.ComponentType.FULL,

Check warning on line 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 104 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'FULL' is declared in unstable package 'com.intellij.collaboration.ui.codereview' marked with @ApiStatus.Experimental
i -> new SingleValueModel<>(new ImageIcon()), contentPanel);

Check warning on line 105 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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 105 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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
Expand All @@ -107,8 +108,10 @@ public static JPanel descriptionPanel(
panelHandle.showAndFocusEditor();
return null;
}));
b.withHeader(contentPanel, actionsPanel);
b.setMaxContentWidth(Integer.MAX_VALUE);
var malakia = new JPanel(null);
malakia.setOpaque(false);
b.withHeader(malakia, actionsPanel);

Check warning on line 113 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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
//b.setMaxContentWidth(Integer.MAX_VALUE);
return (JPanel) b.build();

Check warning on line 115 in src/main/java/network/radicle/jetbrains/radiclejetbrainsplugin/toolwindow/Utils.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
}

Expand Down

0 comments on commit 3b3c6f1

Please sign in to comment.