-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add support for delete hotkey and multiple deletes in browsers #1849
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebjulliand Nice enhancement! 👍 I love keyboard navigation, so this is a very welcome enhancement, although I'm not deleting as much as other operations... 😉 😍
A quick test seems to show some navigation issues:
- In Connection Browser (CB) and Object Browser (OB), when an item is marked and the cursor moved to another item, it's not the item marked by the cursor that will be deleted, but the item selected (filled background). This can be confusing for the user (me!).
- Delete connection confirmation dialog is not modal, but still a warning message.
- In the OB
Delete
does not work if no object is selected. I would expect the object marked by the cursor to be deleted when pressingDelete
. - How do I select a member in OB without it being opened?
- It's not possible to mark objects in OB as in IO - not enabled for OB, since there are no drag'n'drop?
- Pressing
Delete
in IO without marking any files shows the following error:
I hope the navigation issues can be fixed by having Space
mark an item and Enter
open the marked item(s). It's not that intuitive to have to hold Shift
and press Up
or Down
to mark one or more items in the lists... But maybe it's not possible in the current API's? 🙏
@worksofliam I'm looking forward to your review - I think we all should have a try with this PR, since it's about deleting objects and we should reduce the risk of users deleting something by mistake... 🙏 |
Some additional thoughts:
I like the way the delete operation has been changed in the code. So maybe we at least should use that change? FInally, is it just me or does Code for IBM i start faster now, with the new initialization of the Connection Browser? 👍 |
Thank you @chrjorgensen , on point as usual! |
Agree - let's see what the other team members @worksofliam and @Wright4i have to say... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR. Love the UX feature. It might be easier for me to go through and delete all my testing connections now - thanks!
Just some thoughts:
- How do you use the delete key to delete a connection? When you highlight/select a connection, you connect right away.
- You can also apply that logic to the IFS Browser and Object Browser. You can use the delete key without clicking it first (which tends to expand or connect) - though it is still useful.
edit: i realize this is what you and @chrjorgensen were already discussing! Perhaps for the connection, we require them click on the connection button, though this is a huge UX change and likely not to be appreciated by many. But in general, I say key the functionality for IFS Browser and Object Browser.
src/views/objectBrowser.ts
Outdated
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: t("objectBrowser.deleteObject.progress", path, object.type.toUpperCase()) } | ||
, async () => { | ||
// TODO: Progress message about deleting! | ||
const deleteResult = await connection.runCommand({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long term goal, not required here: get this DLTOBJ
into an API. We have checkObject
, why not deleteObject
?
@sebjulliand Something I just found out:
|
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
561c277
to
a6b5f2d
Compare
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
@chrjorgensen , @worksofliam : round 2!
|
@chrjorgensen I'll need your translation skills too! 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebjulliand Could you add the number of elements to the confirmation messages - like it is in the IFS browser? I think that is an extra assurance for the user to see the number of elements that will be deleted - if 3 was supposed to be selected and 4 is mentioned in the message, this is a quick alert.
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
There you go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebjulliand This error is occurring when I start debugging:
[{
"resource": "/d:/Data/Develop/code-for-ibmi/src/views/objectBrowser.ts",
"owner": "typescript",
"code": "2663",
"severity": 8,
"message": "Cannot find name 'isProtected'. Did you mean the instance member 'this.isProtected'?",
"source": "ts",
"startLineNumber": 324,
"startColumn": 105,
"endLineNumber": 324,
"endColumn": 116
}]
Maybe your branch was not updated to latest master?
@sebjulliand Something's wrong with the current state - when I check out your feature branch, I get the following error: Could you fix the merge conflict present and force-push your local branch (having no errors!)? |
Signed-off-by: Seb Julliand <sjulliand@arcadsoftware.com>
@chrjorgensen I had to nuke the branch and make everything clean, so I had to force-push a clean state, hence Git being confused. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: I am getting this message when expanding an *ALL
object filter - but worked fine with *SRCPF
:
Deleting multiple connections works like a charm:
Deleting multiple directories works, but I think a progress indicator would be nice instead of messages for each chosen path, and then perhaps a final message saying they have been deleted. Not a requirement but nice for the user.
Deleting filters worked good:
Signed-off-by: Seb Julliand <sjulliand@arcadsoftware.com>
Signed-off-by: Seb Julliand <sjulliand@arcadsoftware.com>
Thanks for the testing guys.
It goes faster than running rm for each element, that goes without saying 😋 @chrjorgensen I'll need once again a small translation 🙏🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Seb Julliand <sjulliand@arcadsoftware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebjulliand Works great! 😍
Only one issue found: Deleting members shows this confirmation message - with a ()
?
This is supposed to be the member's extension between |
No, no extension... but I think it is quite inconsistent to present a member as |
I made a silly - but valid - test, deleting 500 members in a source file... and found two issues:
Sorry for being a PIA! 😢 |
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
|
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
This reverts commit ef18e83.
@chrjorgensen : I fixed the progress stuck at 0 (rounding made the increment equals to 0...that was silly of me as the progress supports non-integer increments). |
@sebjulliand Looking good to me - merge at will. 😍 |
Changes
This PR adds support for pressing the delete key to delete selected items in the Connection, IFS and Object browser.
It also restore the possibility to delete source files (this was lost with the filter enhancement).
Multiple elements can be deleted at once.
All delete confirmation dialogs are now modals.
Checklist