mainsail-crew / mainsail

Mainsail is the popular web interface for managing and controlling 3D printers with Klipper.
https://docs.mainsail.xyz
GNU General Public License v3.0
1.63k stars 341 forks source link

feat: Add hotkeys tied to Save, Save + Restart #1902

Closed kevinkhill closed 2 weeks ago

kevinkhill commented 1 month ago

Description

I am trying to solve a personal issue of mine with this PR. I compulsively press ctrl+s while making changes in my editor, but this breaks my flow since it launches the save page dialog of the browser.

I propose overriding the default browser behavior for hotkeys with keybindings for our editor actions.

Changes:

Screenshots

I could try and make a screen recording of pressing the hotkeys but I didn't feel like it would add much to the PR

kevinkhill commented 1 month ago

I left this as a draft because I can't seem to figure out why the save and restart is not working. When I press ctrl+shift+s it seems to save, but I get a red error notification also.

image

So it is like it is erroring, but also working?

meteyou commented 1 month ago

thx for this PR. i think i found your issue. if you press "save & restart", it also trigger the "save" command first. if you change the order from the shortcuts in the dialog, it works fine.

meteyou commented 3 weeks ago

@kevinkhill is there anything missing from your side for this PR? it looks good from to me. feel free to switch it to "ready to review".