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

[4.x] Add hotkey to clear entries without confirmation: CMD+K #1364

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

bradleybernard
Copy link
Contributor

Reasoning

Command + K is a common "clear" hotkey, that is supported in various terminals, Ray, and other dev tools. My telescope log quickly fills up, and when I want to test my workflow from start to finish, I often reach for clear entries button and click yes to confirm. It would be great to have that hotkey'd so I could go to my terminal, Ray, and Telescope to get a clean slate across all dev/debug tools, to reduce cognitive load and improve DevEx.

Logic

Super simple, add keydown event listener and if it matches our desired keystroke combination, call existing clearEntries function but pass in a flag to not require confirmation!

Demo video

CleanShot.2023-07-24.at.14.24.05.mp4

@taylorotwell taylorotwell merged commit 43c6ca2 into laravel:4.x Jul 25, 2023
9 checks passed
@taylorotwell
Copy link
Member

Thanks

@bradleybernard
Copy link
Contributor Author

Sweeeet, thanks Taylor! 👌

@bradleybernard bradleybernard deleted the clear-entries-hotkey branch July 25, 2023 16:50
@driesvints
Copy link
Member

Isn't CMD+K more used with search boxes? For almost every docs side, including Laravel's, I get a search box when I use it. In this case I'd expect it to focus on the search input.

@bradleybernard
Copy link
Contributor Author

For docs it is CMD+K, but for any other dev tools like terminals or things with scroll back history, CMD+K is analogous to clear / hide.

For Telescope, I imagine the main use case would be clear, but we can always shift it to be something else if you want to pin that to search. My guess is clear is used much more often than search, but I have no data to back that up 😅

Lemme know! IMO clear is very intuitive and the shortcuts for tools are context dependent, I see Telescope as a primary debug tool, not search being the main piece. Open to other thoughts tho 😇

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