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

feat: mouse support via bubblezone #22

Merged
merged 7 commits into from
Jul 9, 2023

Conversation

whoop-t
Copy link
Contributor

@whoop-t whoop-t commented Jun 24, 2023

Resolves #1

Uses bubblezone(https://github.com/lrstanley/bubblezone)

Some minor changes needed to support mouse via zone, Gruyere needs to be set to fullscreen mode for zone to work(see: lrstanley/bubblezone#11)

Also refactored some title/view rendering to play nicely with bubblezone

@whoop-t whoop-t mentioned this pull request Jun 24, 2023
Copy link
Owner

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

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

Thanks a lot for taking a look at this! Very neat.

One other thing that would be good to update is the menu bar at the bottom to reflect that scrolling is supported for navigation.

image

func (i item) Title() string { return i.title }
func (i item) Description() string { return i.desc }
func (i item) FilterValue() string { return i.title }
func (i item) Title() string { return zone.Mark(i.title, i.title) }

Choose a reason for hiding this comment

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

Not sure what OS/shell you're dev'ing on but on WSL, I'm only able to click on the process description to select the process to kill. The title is unclickable.

I think ideally, someone could click on either title/description for a process and be brought to the confirmation screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm im on linux(popos), zsh shell(kitty terminal) and both are clickable, title and desc

I only have mac/linux at this time so hard for me to test windows/wsl

}
}
// If ok is clicked
} else if zone.Get("ok").InBounds(msg) {
Copy link
Owner

@savannahostrowski savannahostrowski Jun 27, 2023

Choose a reason for hiding this comment

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

With the zones, it'd also be nice to use the active button style for the hover state.

Copy link
Contributor Author

@whoop-t whoop-t Jun 28, 2023

Choose a reason for hiding this comment

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

This was something I looked into for a bit, but not sure zone supports it out of the box. I did not investigate for too long but it didnt look like zone provided anything for hover

It might be nice as another investigation/feature to implement supporting hover, either with zone or some custom custom solution

@whoop-t
Copy link
Contributor Author

whoop-t commented Jun 28, 2023

Thanks a lot for taking a look at this! Very neat.

One other thing that would be good to update is the menu bar at the bottom to reflect that scrolling is supported for navigation.

image

Ill take a look at adding this to the list when I have some more time, busy this week/weekend

@whoop-t
Copy link
Contributor Author

whoop-t commented Jul 7, 2023

f090f26 adds help context for mwheel scroll

If we wanted to customize the help menu more, we may need to just build our own, im just adding additional keys

I think hover should be another investigation/pr, I dont think zone supports its out of the box

Clicking title OR description works to select the port on my machine(Linux/PopOS). Im am not able to test on WSL. This could be fine for now and have someone with WSL/Windows investigate it further as I am not able to

@savannahostrowski let me know if you think this is good or if there should be other fixes

@savannahostrowski
Copy link
Owner

Hey - I think that this looks good. Thanks for added the mwheel to the help menu.

I'm cool with hover being investigated in another PR.

Re. clicking the title/description, I'm testing on WSL and it's a bit finicky. Not sure why yet. Mousewheel + enter works great though. I think we can merge as is and I can poke around a bit more on my end.

@savannahostrowski savannahostrowski merged commit b00d1d7 into savannahostrowski:main Jul 9, 2023
@whoop-t whoop-t deleted the mouse-support branch July 9, 2023 22:28
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.

Allow for mouse navigation
2 participants