SwarmUI
SwarmUI copied to clipboard
Hotkey Shortcuts for Delete/Star/etc. Image Actions
Feature Idea
the image browser already has <- and -> so all that's missing is delete, to do some clean up.
Other
No response
Thoughts on impl here:
The first thing to build:
- Should be a generalized hotkey system first, not specific to these features per se
- Should be user-configurable easily. At least a user settings text box where a user can type
deletefor the delete key orctrl+dor whatever for that, and on settings load it parses and registers the hotkeys - should replace the impl of ctrl+enter global generate trigger hotkey
- should be a JS class,
HotkeyHandleror something, probably under the user settings js file - probably that class has a registrable map of like...
register("settingname", () -> { action(); });that gets populated by other JS (and potentially by extensions) and then handler actually builds the event handlers a few ticks after the main genpage load event (extra delay just to preempt issues with handling order) - take care around how hotkeys behave when eg you're typing in a textbox. Ctrl+Enter should still generate, but
Deleteshould not delete your image if you're deleting text. I'm not sure the optimal solution here - maybe only prefixed (ctrl/alt/?) keys are textbox-irrelevant?
And then, separately, as a followup job:
- impl specific to image actions
- maybe see about sub-rendering keybinds on the menu? At least a
titleaddition of egHotkey: deleteor whatever, but maybe also on the dropdown view of things it uses the gray side rendering (see eg how in<lora:list it can renderSDXLon the side) - when impling image actions, take care about splitting the menus that are the same between current image view and image history/etc
Additionally:
- a proper direct event registration may also require a refactor of CurrentImageHandler to make these functions more accessible, iirc they are currently handled via inside-a-func unique per image registrations, rather than CurrentImageHandler having a global callable func, but any hotkey registration needs to be a global callable
- that refactor is a nontrivial job and if it's needed is a maintainer-only task, the other bits are open to PRs though I think