vscode-ibmi icon indicating copy to clipboard operation
vscode-ibmi copied to clipboard

Collapse all/Expande all

Open pabloto opened this issue 2 years ago • 1 comments

I don't know if this function exist or not, but I have some qrpglesrc with thousand of members, and if I want to return to the list of pf-src I have to scroll up until I can close the member list, It should be interest to have a button in object browser to collapse all members list.

Many thanks

pabloto avatar Sep 21 '22 11:09 pabloto

Yes, a button to collapse all in the object browser would be very nice.

worksofliam avatar Sep 21 '22 12:09 worksofliam

I don't think we will add expand all, as it will send quite a lot of requests to the server, but collapse all is absolutely doable.

  collapse() {
    vscode.commands.executeCommand(`workbench.actions.treeView.${viewId}.collapseAll`);
  }

This would be added to both the object browser and IFS browser classes, then commands defined for them both and then added to each of the views.

worksofliam avatar Mar 10 '23 03:03 worksofliam

I could Have a look on....

novy400 avatar Mar 10 '23 09:03 novy400

@pabloto While you wait for the button to be implemented, you can use the builtin key-combination of Ctrl-Left to collapse the tree view. This actually works for all VS Code treeviews.

chrjorgensen avatar Mar 10 '23 10:03 chrjorgensen

Hi @chrjorgensen , I have a Mac , I didn't find the relative shortcut...

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

pabloto avatar Mar 10 '23 12:03 pabloto

Hi @pabloto I've never been on a Mac, but I found it in the keyboard shortcuts on Windows, searching for collapse:

billede

There's even one shortcut LeftArrow for collapsing a single node in the tree.

If the functions are not mapped to any key, you can map them yourself.

chrjorgensen avatar Mar 10 '23 12:03 chrjorgensen

Hi @chrjorgensen ,

thank you. this is the shortcut for mac:

image

move to macos, it's really better!!!

pabloto avatar Mar 10 '23 12:03 pabloto

@pabloto Yeah, everything is better than Windows. Wish the world were more open to open standards and not Big Tech companies, so I could use my Linux partition on my laptop. 😄

On Mac it is Cmd key instead of Ctrl key - so I was almost right about the keyboard shortcut, even without ever been on a Mac. 😆

chrjorgensen avatar Mar 10 '23 12:03 chrjorgensen

Not sure to really understand ...but if this feature already exists. and as @chrjorgensen mentions it , we can use the command list.collapse and list.collapse.all with keysbinding.(I've tested It's ok) . is it really usefull to add buttons in the view to do so ?

novy400 avatar Mar 10 '23 13:03 novy400

@novy400 I think it's worth putting a button in the UI for this - I've already done it in the search result view.

It's not obvious to users that one can collapse a node or tree by pressing a keyboard shortcut, and a button is much more obvious. It's even used in VS Code itself - in the Explorer and Search views.

chrjorgensen avatar Mar 10 '23 14:03 chrjorgensen

😉 cool so it's ok I can have a look on ....

novy400 avatar Mar 10 '23 16:03 novy400

I've found a way to do it . but it's a bit late now , I don't want to destroy the project 😁💥💥 so I'm working on tomorow. @chrjorgensen I haven't red all your message (😭) but yes It's confirm my thinking (😉) I'm going to do it like you have already done in searchResultView

novy400 avatar Mar 10 '23 21:03 novy400

yop It's done but two questions before PR :

  1. Position of the icon "collapse" image
  • Which order for the icons ?
  • If I want to order the icons ,is it with change of "group": "navigation" to "group": "navigation@1" in package.json ?
  • do you have an idea of a new order for them ?
  1. js to ts
  • do I have to translate the js file to ts file (ifsbrowser.js and objectBrowser.js ) ? ( Perhaps I can do it but in ts i'm a newbie...) have a good day ! yvon

novy400 avatar Mar 11 '23 09:03 novy400

I think we should group the Refresh and Collapse all buttons and place them to the far right (since they both act on the view content and that's how VS Code arranges them in the File Explorer view, which most are familiar with) and in the specified order: billede

The icons are sorted by name in a navigation group, so you should put Refresh into navigation@1 and Collapse all into navigation@2. Try that...

Leave the file as JavaScript - and the conversion to Typescript to the experts (and I'm not an expert! 😆). Let's get this into the extension asap.

chrjorgensen avatar Mar 11 '23 11:03 chrjorgensen

Thanks @chrjorgensen PR done...

image

novy400 avatar Mar 11 '23 14:03 novy400

Implemented. Thank you @novy400!

worksofliam avatar Mar 12 '23 18:03 worksofliam