Skip to content
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

OCGV: Request: Focus a specific row on opening the grid view #127

Open
LarsFosdal opened this issue Oct 29, 2020 · 5 comments
Open

OCGV: Request: Focus a specific row on opening the grid view #127

LarsFosdal opened this issue Oct 29, 2020 · 5 comments
Labels
Milestone

Comments

@LarsFosdal
Copy link

Consider:
$L = Get-TineWMSLocation -StagingLive
$P = Get-TineWMSLocation -StagingPilot
$T = Get-TineWMSLocation -StagingTrunk
$List = @($L, $P, $T)
$sel = $List | Select-Object BuildName, GlobalLocationId, LocationName | Out-ConsoleGridView -OutputMode Single -Title "Select Build for synchronisation"

Coming to this code, I have a target which has buildname 'Pilot', i.e. the second of the options.
I would like to have that option preselected so that all the user has to do, is to press enter.

Suggestion - add an option to focus a row.
F.x. Out-ConsoleGridView -OutputMode Single -Focus 'Live'
-Focus could use the first column as "key"
This could also work for -OutputMode Multiple where it would focus the first list row where the first column matches the focus string.

@tig
Copy link
Collaborator

tig commented Jan 22, 2021

Groovy idea.

So the -Focus parameter is a search string. A simple implementation would require it to match perfectly. An complex implementation would make it a regex or something.

@tig
Copy link
Collaborator

tig commented Aug 24, 2022

@andschwa please prefix title with "OCGV: ".

I really like this suggestion. I suggest it get implemented when I move OCGV to use Terminal.Gui's built in Table class.

@andyleejordan andyleejordan changed the title Request: Focus a specific row on opening the grid view OCGV: Request: Focus a specific row on opening the grid view Aug 24, 2022
@claudio-salvio
Copy link

So the -Focus parameter is a search string. A simple implementation would require it to match perfectly. An complex implementation would make it a regex or something.

Hi @andschwa, @LarsFosdal

I agree on the usefulness of incorporating a search function.
However, it seems to me that it would be better to have two independent parameters: Focus and Search

The Focus parameter would be used to set which interface element has the focus initially. Currently it would have two possible values: Filter, Grid.

The Search parameter would be responsible for positioning the cursor on the first element of the list that meets the search condition. Perhaps it would be convenient if the rows (or cells) that match the search were also highlighted in the grid.

Something to analyze is whether it would be convenient to add the Search field in the interface as it currently is Filter. In grids it is frequent that these two functionalities can be accessed independently of each other. If we decide affirmatively in this sense, Search should be added as another possible value of Focus.

Functionally, Filter hides the items that don't match in the grid, Search only highlights them and allows us to navigate from one to another. For the latter, the corresponding keyboard shortcuts should be added.

Kind regards,
Claudio Salvio

@LarsFosdal
Copy link
Author

I concur. Good suggestions!

@tig
Copy link
Collaborator

tig commented Apr 27, 2023

I love this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants