vlaaad / reveal

Read Eval Visualize Loop for Clojure
https://vlaaad.github.io/reveal/
MIT License
600 stars 21 forks source link

Add key shortcut to clear output panel #14

Closed nenadalm closed 3 years ago

nenadalm commented 4 years ago

fixes #12

Hi. Thanks for the awesome app. I am trying to write log viewer for postgres (https://github.com/nenadalm/postgresql-log-viewer#postgresql-log-viewer) and currently I am investigating if it is possible to use some existing data browser as ui.

It would be nice if I could clear queries so far (say before making a http request that produces some queries) and see all queries that happened during that request. It seems that code in this pr does the trick.

vlaaad commented 4 years ago

Hi @nenadalm!

Thanks for your interest, it's a simple and focused contribution 👍

Unfortunately, as minor as it seems, I decided not to accept it today because I don't like the idea of growing the amount of shortcuts that don't have any discoverability. Ctrl+F as search and Ctrl+C as copy might be ubiquitous, but Ctrl+D as clearing is not. I am planning to add a way to add contextual actions on views that are discoverable and extensible, and clearing the output absolutely will be there, but that will probably cause the whole keyboard event handling to change.

nenadalm commented 4 years ago

Thanks. That would be great.

Portal (another data browser), has such commands: https://github.com/djblue/portal/blob/8227595ee3c32e3f36c38d5e6c6e3cf19198f4be/src/portal/ui/commands.cljs#L305 which can be shown by opening command menu using ctrl+shift+p, which works like the one in vscode (https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).

Also I just noticed that Portal is using ctrl+l to clear the output (I was using button to do that as I didn't know about the shortcut), so maybe should there be shortcut in reveal, it could be also ctrl+l instead of ctrl+d as in this pr.

I suppose that contextual actions in reveal will work similar way as commands in portal/vscode?

vlaaad commented 4 years ago

I haven't decided yet how they will look like, could be like in vscode/portal :)

Thank you for understanding and patience!

svdo commented 3 years ago

Just my 2 cents:

vlaaad commented 3 years ago

I understand. I'll try to release something soon, probably bound to Ctrl+L or Ctrl+K.

vlaaad commented 3 years ago

Released 1.1.171 that adds Ctrl L as a shortcut for clearing the output panel. It uses Ctrl (instead of ) on Mac too for consistency.

svdo commented 3 years ago

Super duper! Very happy with that feature :)