ConsoleGuiTools icon indicating copy to clipboard operation
ConsoleGuiTools copied to clipboard

OCGV: If items are selected, then a filter is applied, items now hidden stay selected

Open tig opened this issue 5 years ago • 3 comments
trafficstars

What does Filter do?

  1. Filter means Filter DISPLAY - Restrict what you see (current implementation).
  2. Filter means Filter INPUT - Restrict the data you are working with.

Example:

Get-PSProfile | Out-ConsoleGridView -OutputMode Multiple -Title 'PS Profiles'

Select the two items: image image

Change the filter to "ISE": image

Select the first ISE item: image

Hit ENTER to Accept.

Note three items are returned: image

Thus, today, the Filter only impacts what is displayed.

Is this the right behavior?

I could argue it either way, but being explicit is going to be more important as ocgv gains more functionality (e.g. See my Select-All issue #120). I also have dreams of a cmdlet that makes editing data easy via console GUI. It seems to me we'd want the model to be consistent (or at least explicitly inconsistent).

Note, ogv works differently. If you select things in -OutputMode Multiple mode, and then change the filter, those selections are cleared. One could also argue that ocgv should match ogv here, which means it should use "Filter Means Filter INPUT" (2).

tig avatar Oct 02 '20 19:10 tig

Here's my reminder to myself to read the whole thing before I start formulating my response 😬 I went and tested Windows PowerShell's ogv implementation to find exactly as you did that it means option 2. This is definitely the behavior I would expect and I would advocate for.

As a side note: @tig is Get-PSProfile a custom function, or is it part of a module that someone might be able to download?

corbob avatar Oct 02 '20 20:10 corbob

Get-PSProfile is part of https://github.com/jdhitsolutions/PSScriptTools.

I forgot how I found it, but use it for testing because it gives lots of columns with different lengths and thus stresses ocgv well. I forgot it wasn't a built-in.

I'll do a PR to "fix" ocgv per this Issue...

tig avatar Oct 02 '20 23:10 tig

I believe this should be fixed. Working on PR now.

tig avatar Aug 04 '22 00:08 tig

Fixed in #166

tig avatar Aug 24 '22 12:08 tig