Skip to content
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(core): Fix ContextMenu event of CompressedTreeWidget does not take effect #11230

Conversation

zhaomenghuan
Copy link
Contributor

@zhaomenghuan zhaomenghuan commented May 31, 2022

What it does

Fixes: #10902.
The pull-request fixes the context-menu event for the CompressedTreeWidget.

Before fixing:

contextmenu.mov

After fixing:

contexmenu2.mov

How to test

  1. start the application using compression-example as a workspace
  2. confirm that the compressed nodes in the tree can be selected, clicked, and trigger the context-menu for each part of the compressed node as in the videos

Review checklist

Reminder for reviewers

Signed-off-by: zhaomenghuan 1028317108@qq.com

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution 👍

The ECA check seems to fail since your authorship email and sign-off do not match:

From be62ba392993a0a493de59e025c672125a334132 Mon Sep 17 00:00:00 2001
From: zhaomenghuan02 <zhaomenghuan02@meituan.com>
Date: Tue, 31 May 2022 21:51:29 +0800
Subject: [PATCH] fix(core): Fix ContextMenu event of CompressedTreeWidget does
 not take effect

Signed-off-by: zhaomenghuan <1028317108@qq.com>
---
 .../browser/tree/tree-compression/compressed-tree-widget.tsx  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/core/src/browser/tree/tree-compression/compressed-tree-widget.tsx b/packages/core/src/browser/tree/tree-compression/compressed-tree-widget.tsx
index 609e777404c8..c2f22f3b5ad5 100644
--- a/packages/core/src/browser/tree/tree-compression/compressed-tree-widget.tsx
+++ b/packages/core/src/browser/tree/tree-compression/compressed-tree-widget.tsx
@@ -123,8 +123,8 @@ export class CompressedTreeWidget extends TreeViewWelcomeWidget {
     protected getCaptionChildEventHandlers(node: TreeNode, props: CompressedNodeProps): React.Attributes & React.HtmlHTMLAttributes<HTMLElement> {
         return {
             onClick: event => (event.stopPropagation(), this.handleClickEvent(node, event)),
-            onDoubleClick: event => (event.stopPropagation(), this.handleClickEvent(node, event)),
-            onContextMenu: event => (event.stopPropagation(), this.handleClickEvent(node, event)),
+            onDoubleClick: event => (event.stopPropagation(), this.handleDblClickEvent(node, event)),
+            onContextMenu: event => (event.stopPropagation(), this.handleContextMenuEvent(node, event)),
         };
     }

@zhaomenghuan zhaomenghuan force-pushed the bugfix/compressed-tree-widget branch 2 times, most recently from 3a032fa to f9d0d07 Compare May 31, 2022 15:13
…e effect

Signed-off-by: zhaomenghuan <1028317108@qq.com>
@vince-fugnitto vince-fugnitto added the tree issues related to the tree (ex: tree widget) label May 31, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm that the changes work well, and resolve the issue 👍
The double-click and context-menu events now properly work for compressed file-tree nodes.

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can also confirm that the changes fix the issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tree issues related to the tree (ex: tree widget)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some issues in the explorer/navigator tree context menu on the new compressed folders mode in Theia 1.23
3 participants