Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

UziTech
Copy link
Contributor

@UziTech UziTech commented May 22, 2017

Description of the Change

fixes unselecting multiple entries when right clicking on a selected entry.

screenshot

@winstliu
Copy link
Contributor

Nice. Can you please add a spec for this?

@UziTech
Copy link
Contributor Author

UziTech commented May 23, 2017

When ever I try to run the tests on my machine I get

Error: Cannot find module '../build/Release/pathwatcher.node'

@winstliu
Copy link
Contributor

winstliu commented May 23, 2017

Did you apm install instead of npm install? Followed by maybe an apm rebuild?

@UziTech
Copy link
Contributor Author

UziTech commented May 23, 2017

That worked thank you

@UziTech
Copy link
Contributor Author

UziTech commented Jun 15, 2017

Any word on this? @50Wliu is there a reason the needs-testing flag is still on this?

@winstliu
Copy link
Contributor

Sorry for the delay. needs-testing can serve different purposes - I use it to denote that a feature needs to be tested (as in, by interacting with the change in Atom), not that it needs specs.

Finishing up my last few language-php PRs and working on a language-html PR, then I'll probably get to this.

@UziTech
Copy link
Contributor Author

UziTech commented Jun 15, 2017

sounds good. thanks

@winstliu
Copy link
Contributor

There's some styling issues going on when multi-selecting: the Tree View gets pushed slightly to the left. Looks like a lot of the styles only target .full-menu and not .multi-select.

Full Menu Multi Select
full-menu multi-select

@winstliu
Copy link
Contributor

winstliu commented Jun 15, 2017

/cc @simurai: could you help with the above? ☝️ It looks like you added the .full-menu styles in #1111.

Following diff seems to work, but I'm wondering if there's a better way.

diff --git a/styles/tree-view.less b/styles/tree-view.less
index b0851a7..83db906 100644
--- a/styles/tree-view.less
+++ b/styles/tree-view.less
@@ -13,7 +13,7 @@
   display: flex;
   flex-direction: column;
 
-  .full-menu {
+  .full-menu, .multi-select {
     /*
      * Force a new stacking context to prevent a large, duplicate paint layer from
      * being created for tree-view's scrolling contents that can make the cost of
@@ -30,14 +30,14 @@
     padding-right: @component-padding;
     background-color: inherit;
 
-    // Expands .full-menu to take up full height.
+    // Expands .full-menu and .multi-select to take up full height.
     // This makes sure that the context menu can still be openend in the empty
     // area underneath the files.
     flex-grow: 1;
   }
 
-  .full-menu.list-tree {
-    // Expands .full-menu to take up as much width as needed by the content.
+  .full-menu.list-tree, .multi-select.list-tree {
+    // Expands .full-menu and .multi-select to take up as much width as needed by the content.
     // This makes sure that the selected item's "bar/background" expands to full width.
     position: relative;
     min-width: min-content;
@@ -47,10 +47,6 @@
     position: relative;
   }
 
-  .list-tree {
-    position: static;
-  }
-
   .entry {
     // This fixes #110, see that issue for more details
     &::before {

@UziTech
Copy link
Contributor Author

UziTech commented Jun 16, 2017

it seems like just using .list-tree would work better than .full-menu, .multi-select. That way if any other state class was added in the future we wouldn't run into the same issue.

@UziTech
Copy link
Contributor Author

UziTech commented Jun 16, 2017

never mind .list-tree seems to be on any expanded folder. A new class should probably be added.

@simurai
Copy link
Contributor

simurai commented Jun 16, 2017

@50Wliu It looks like you added the .full-menu styles in #1111.

Ouch.. 😩 Didn't realize that .full-menu is more like a "state". Also, it seems that

.list-tree {
  position: static;
}

is still needed when dragging.

@UziTech A new class should probably be added.

Yes, added a new .tree-view-root class in #1130.

Copy link
Contributor

@winstliu winstliu left a comment

Choose a reason for hiding this comment

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

Looks good. Just a few minor spec comments.

button: 2
})

expect(treeView.getSelectedEntries().length).toBe(2);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about another assertion to make sure that the multi-select class is present?

treeView.showMultiSelectMenu()

let child = entries.children[0];
while (child.children.length > 0 && (child = child.firstChild));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this while loop be expanded?

@winstliu
Copy link
Contributor

Going to block this on #1130 to ensure that we don't forget about that.

@mrveress
Copy link

Hello everyone! Sorry for the question: when this functionality be in the new release? I waiting this almost 3 month and press context button on the keyboard (my context key almost destroyed because of this 😄 )

@UziTech
Copy link
Contributor Author

UziTech commented Jul 19, 2017

@mrveress kind of hacky but I am using this in atom now by doing the following steps:

  1. Fork this branch
  2. Change the name property in package.json to "tree-view-temp" (or anything that is not the name of another package)
  3. Disable the core "tree-view" package in atom
  4. Install the forked package with the github url

Just make sure to uninstall that package and enable "tree-view" when it ships with this merged, or keep the forked branch up to date.

@simurai
Copy link
Contributor

simurai commented Jul 21, 2017

FYI: PR #1130 is now merged.

@winstliu
Copy link
Contributor

@UziTech please rebase and then I'll give this a final test run.

@UziTech
Copy link
Contributor Author

UziTech commented Jul 21, 2017

All test passed 👍 💯

const entries = treeView.roots[0].entries
treeView.selectEntry(entries.children[0])
treeView.selectMultipleEntries(entries.children[1])
treeView.showMultiSelectMenu()
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid explicitly stating this in the spec, is it possible to do a treeView.onMouseDown event on entries.children[1]?

@winstliu winstliu merged commit 8d28d89 into atom:master Jul 21, 2017
@winstliu
Copy link
Contributor

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants