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

Allow for Esc to clear all filters #625

Merged
merged 4 commits into from Jan 21, 2021

Conversation

Vigasaurus
Copy link
Contributor

Changes

Resolves #575

Tests

  • This PR does not require tests

Changelog

  • Entry has been added to changelog
    Same as my other PRs heh - lmk what you want for changelog format and I'll get it sorted

Documentation

  • Docs have been updated
  • This change does not need a documentation update
    🤷‍♂️

@metmarkosaric
Copy link
Contributor

Nice! Our keyboard shortcuts game is getting stronger! I like it!

@Vigasaurus
Copy link
Contributor Author

Vigasaurus commented Jan 20, 2021

I'm actually considering something else too, but I did actually want y'all's feedback/opinions.
firefox_2021-01-16_01-34-31

I don't know that actually showing them here is necessary, but I thought something like this very similar to how calendar apps work could be neat. (This is just a mock up made in paint) The keybinds and the UI are the main things I wanted opinions on.

For the Custom I thought it would be cool for it to just open up the Calendar input automatically, and for the others to do what you'd expect (i.e. exactly what clicking the button would do)

Google Calendar's implementation:
image

@metmarkosaric
Copy link
Contributor

metmarkosaric commented Jan 20, 2021

that's very cool and i was thinking to share that idea. i didn't know it's a google calendar thing but last week we started using Hey for email and they do that everywhere and I really like it (just need to get used to the different keybindings)

Screenshot from 2021-01-20 09-47-25

showing the keybinding in the UI makes sense to make people aware of it and remember it and i like your implementation! and just using the first letter of what the action is makes sense to me (c for custom etc). if we introduce this, i would add a keyboard shortcuts page to the docs too.

@Vigasaurus
Copy link
Contributor Author

Sounds good (I've always been meaning to try hey but ... lazy)! How do you feel about the following, then? I think some of the more obscure ones don't need a binding, but lmk if you think there should be one for any.

Dropdown Action Keybind
Today D
Realtime R
Last 7 days W
Last 30 days
Month to Date M
Last month
Last 6 months
Last 12 months Y
Custom range C

@metmarkosaric
Copy link
Contributor

looks good to me @Vigasaurus! good that it follows google calendar as i assume that may be the standard that's used in more apps too.

Copy link
Contributor

@ukutaht ukutaht left a comment

Choose a reason for hiding this comment

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

Feel free to add to the 1.2 - unreleased section on the changelog.

handleKeyup(e) {
const {query, history} = this.props

if (e.ctrlKey || e.ctrlKey || e.altKey) return
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like ctrlKey is checked for twice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah haha - I just copied this from the DatePicker arrows, didn't even notice 🙈

One of them should be metaKey, I believe

@ukutaht ukutaht merged commit da7ccc4 into plausible:master Jan 21, 2021
oliver-kriska pushed a commit to payout-one/analytics that referenced this pull request Jan 26, 2021
* Allow for `Esc` to clear all filters

* Changelog

* Change duplicated ctrlKey (in DatePicker too)
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.

None yet

3 participants