OCGV:Different Filter will "forget" all selected before
MrFly72 opened this issue · 24 comments
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
When a filter is active at the end of choosing elements, only the elements that are included in the active filter will be returned.
eg.:
Get-Process | Out-ConsoleGridView
Check one process, eg. Word
Filter by eg.Notepad, check Notepad
When you now hit enter with the active filter for notepad, only notepad will be returned
There is only one workaround this, you have to remove the filter before hitting enter.
This bug is introduced in the newer version, as before, hitting enter in a filtered list, would gather all elements that have been checked.
Expected behavior
Word + Notepad should be returned
Actual behavior
Only notepad is returned
Error details
No Error ourput
Environment data
Name Value
---- -----
PSVersion 7.2.6
PSEdition Core
GitCommitId 7.2.6
OS Linux 5.15.56-v8+ #1575 SMP PREEMPT Fri Jul 22 20:31:26 BST 2022
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
0.7.2
Visuals
No response
I want to describe my impact on this a little bit more in detail.
I am using OCGV on a Raspberry Pi for a script I wrote to automate Media Download from State TV.
Basically it filters series etc. by rest-api from a source-page, then displays them with OCGV to check for shows to be downloaded.
To easier check them, as it is usually a list of 1800 shows, I filter them, eg. "Show 1", then check the ones to download, then filter by "show 2" and mark others to download and so on.
at the end, i press enter to accept all shows and then the script will add download jobs on my NAS by rest-api.
it will wait for all shows to download and rename them by defined pattern (eg. Date-Series.Title-Episode-Title.mp4).
I know, that the Windows Version of OGV, also does not "keep" marked entries by "CTRL", but on the other end there are no checkboxes, so totally different approach.
For me it would be valuable, for the checkmarks to be persistent through filters.
At the moment, the workaround for me is, to remove the filter before "enter", as the checkmarks will persist.
The only bummer is, that you really have to clear filter by "backspace" character by character
The only bummer is, that you really have to clear filter by "backspace" character by character
The Filter
has a ContextMenu
with a Delete All
where you can delete all text at once.
How do I reach the context menu on Linux shell?
Did not find any possibility in an ssh shell
How do I reach the context menu on Linux shell? Did not find any possibility in an ssh shell
By mouse right clicking on the TextField
or by pressing Ctrl+Shift+D. But I see that this isn't working on the current build. I submitted this pr gui-cs/Terminal.Gui#1968 to allow pressing Ctrl+R, because Linux don't differentiate Ctrl+alfa from Ctrl+Shift+alfa.
Mouse? Hehe. Don't use one on my iPad which connects via SSH to the raspian shell and then use the shell to start pwsh.
So keyboard is essential for this.
Mouse? Hehe. Don't use one on my iPad which connects via SSH to the raspian shell and then use the shell to start pwsh. So keyboard is essential for this.
I forgot to mention that the context menu can be opened with the keyboard by pressing Shift+F10
, but I don't know why it isn't opening with the current build.
Ok. I mean I can understand that some people want it this way (Filter will forget all previously checked).
As in the thread which changed this was mentioned, there are people who want his behavior and some don't. This is a typical area for a switch. Default could be "drop selections" and a switch like -keepselectsonfilter could keep them.
I must realize, that I more then once walked into this issue, even after knowing that it changed.
HAd this great way before:
- Filter --> Select
- Filter something else --> Select
- ....
- hit enter and go.
now the way is to get back to "without filter" first and then hit enter, and I forget that pretty much all the time.
Additionally to that, this change is also not complety thought through, as the elements keep checked and when you get back to "no filter", the ones from before the filter are still checked.
I think it really needs a switch like "Keep selected on filter change" which should also take all into count on pressing enter.
and if the switch is not set, it would also forget the selected from before the filter.
But nevertheless I think this would be time for a gui-enhancement, too.
there could be a couple of values: #selected in this filter + #selected total.
Would a solution be to 'pin' selected items regardless of filter? So if an item is checked then it doesn't disappear even when the filter is changed? That should make clear that the ticked items are going to be confirmed even if they don't match the filter?
Sort of like this:
Ignore the random reorder of items as they are ticked ;)
Apologies if I have misunderstood the issue.
Would also be ok in my eyes.
And I think the counter of how many are selected is also not a bad idea.
That is the best solution. Maintaining a track on each new filter to the ID of all the available items from the empty filter.
Is someone actively working on this?
I must really admit that I really often "pitfall" into this.
Filter, check some element, filter something else, check some additional and then forget to delete filters and will only have the elements with the checked ones in the second filter.
Btw. I use this in a list with about 2000items, where without filtering, it is not really nice to select.
A solution would be very welcome!
I def want to fix this!
I will get to it asap.
Any news?
Meanwhile i get used to
- filter
- select
- different filter
- select
- ...
- don't forget to unfilter before enter or you loose Checked elements
No update at this time. On my list to work on but been super busy. Sorry.
Any news on this?
Looks great. Can tell you how it feels when able to try.
Putting @MrFly72's question in right thread:
One first question. How does it behave if the screen eg. Only shows 20 elements and I have already selected 18. is the scrolling area then still 20 and the pinned elements will "walk up" in the list or are place 1-18 fix with the pinned elements and only the lines 19-20 will move?
The pinned elements currently are just the top elements in the filtered list. They scroll with the list.
Making them actually be pinned (so they don't scroll) would be a big change...
That was my intent. I'll look to see what I did wrong.