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

Fix exit using 'StatusBar'. Finally/Properly addresses Issue #61 #85

Merged
merged 18 commits into from
Apr 19, 2020

Conversation

tig
Copy link
Collaborator

@tig tig commented Apr 17, 2020

See Issue #61.

Here's how it looks/works:

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably do a rebase/merge what's currently in master into this branch as I still see changes that were in the other PRs

This is looking good though!

@tig
Copy link
Collaborator Author

tig commented Apr 18, 2020

Now?

@TylerLeonhardt
Copy link
Member

Since the status bar items aren't buttons, maybe it's a good idea to include a 3rd one ~SPACE~ Mark item

That way the status bar represents more of a legend.

@TylerLeonhardt
Copy link
Member

Also just want to confirm... What happens when you press ENTER and you have nothing selected and OutputMode is set to Multiple

@tig
Copy link
Collaborator Author

tig commented Apr 19, 2020

Also just want to confirm... What happens when you press ENTER and you have nothing selected and OutputMode is set to Multiple

It exits with no items selected. Which makes perfect sense to me.

@tig
Copy link
Collaborator Author

tig commented Apr 19, 2020

Since the status bar items aren't buttons, maybe it's a good idea to include a 3rd one ~SPACE~ Mark item

That way the status bar represents more of a legend.

Seems like a reasonable ask. Done.

@TylerLeonhardt
Copy link
Member

@tig do you know if the filter "filters on type" now? I know that was an active issue in gui.cs. If so, we can get rid of the apply button here.

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo

// Use Key.Unknown for SPACE with no delgate because ListView already
// handles SPACE
new StatusItem(Key.Unknown, "~SPACE~ Mark Item", null),
new StatusItem(Key.Enter, "~ENTER~ Accept", () => Accept()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought of another concern with ENTER... if the user types in the filter box, they might be inclined to hit ENTER to apply the filter. (especially if it doesn't filter-on-type which was a known issue in gui.cs)

I know I do this all the time in basically any search box.

I would hate for my ocgv to accidentally close from me wanting to apply the search.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative would be to have Ctrl+Enter to accept?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still prefer Ctrl+X for Exit (used by Nano) or Ctrl+Q for Quit (used by Micro), but ok waiting on user feedback.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this is how Windows (and Mac and I think Linux) GUI modal windows work. ENTER accepts and ESC cancels.

Nobody is confused here:
image

The filter is real-time, right? So there is no need for a user to hit ENTER to make it do it's thing, right?

One thing we could do, if this proves to be a problem (which I don't think it will be), is to make it so that if the filter TextField has focus, ignore ENTER (or move focus to the list).

But I don't think this will be a problem because Out-ConsoleGridView is a modal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we ship it as-is and wait for user feedback. The model, as-is, is simple and matches an existing well established idiom.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

especially if it doesn't filter-on-type which was a known issue in gui.cs

Tyler, do you know if there's an issue filed against gui.cs for this? I can't find one; happy to create and look into it regardless.

Copy link
Member

@TylerLeonhardt TylerLeonhardt Apr 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's fixed: gui-cs/Terminal.Gui#349

If the filter Changed event is working now, then can you remove the apply button in this PR? I don't want any confusion with the ENTER key.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. This is much better this way.

Note there are bugs in the filter code though. I'll report them separately, but they have to do with filtering for single chars. Some seem to exist in ogv and some seem specific to the ocgv implementation...

@SteveL-MSFT
Copy link
Member

In the gif, the first time it's run, a portion of the left and right borders is missing?

@tig
Copy link
Collaborator Author

tig commented Apr 19, 2020

In the gif, the first time it's run, a portion of the left and right borders is missing?

Yes; Fixed here: #83

@TylerLeonhardt
Copy link
Member

I will merge this in and will have a fix for the filter shortly after.

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

Successfully merging this pull request may close these issues.

3 participants