feat(ui): right-click send-to-control for prompt/params transfer

Right-clicking the "Send to Images" button now offers two entries:
one copies the prompt only, the other copies all generation parameters
except the image itself. Available in gallery, txt2img, img2img, and
extras. Keeps the results toolbar compact.

- extend ParamBinding with skip_image and only_prompt flags
- create prompt/params variants in all four output panels
- register per-tab context menu entries scoped to #{tab}_tabitem
- match menu selectors via e.target.closest for nested-icon clicks
- document the right-click surface in the "➠ Control" locale hint
This commit is contained in:
CalamitousFelicitousness
2026-04-12 21:38:33 +01:00
parent 607ea1f6b0
commit afff6c1852
4 changed files with 81 additions and 25 deletions
+14 -4
View File
@@ -67,8 +67,9 @@ const contextMenuInit = () => {
if (oldMenu) oldMenu.remove();
menuSpecs.forEach((v, k) => {
const items = v.filter((item) => item.primary);
if (items.length > 0 && e.composedPath()[0].matches(k)) {
showContextMenu(e, e.composedPath()[0], items);
const matched = e.target.closest(k);
if (items.length > 0 && matched) {
showContextMenu(e, matched, items);
e.preventDefault();
}
});
@@ -78,8 +79,9 @@ const contextMenuInit = () => {
if (oldMenu) oldMenu.remove();
menuSpecs.forEach((v, k) => {
const items = v.filter((item) => !item.primary);
if (items.length > 0 && e.composedPath()[0].matches(k)) {
showContextMenu(e, e.composedPath()[0], items);
const matched = e.target.closest(k);
if (items.length > 0 && matched) {
showContextMenu(e, matched, items);
e.preventDefault();
}
});
@@ -161,5 +163,13 @@ async function initContextMenu() {
appendContextMenuOption(id, 'Refine & HiRes pass', () => reprocessClick(`${tab}`, 'reprocess_refine'), true);
appendContextMenuOption(id, 'Detailer pass', () => reprocessClick(`${tab}`, 'reprocess_detail'), true);
}
// Right-click send-to-control button for prompt/params-only transfer.
// Scoped per tab because #control_tab and its paired #control_tab_prompt /
// #control_tab_params elements are duplicated across output panels.
for (const tab of ['gallery', 'txt2img', 'img2img', 'extras']) {
id = `#${tab}_tabitem #control_tab`;
appendContextMenuOption(id, 'Transfer only prompt to Images tab', () => document.querySelector(`#image_buttons_${tab} #control_tab_prompt`)?.click());
appendContextMenuOption(id, 'Transfer all parameters to Images tab', () => document.querySelector(`#image_buttons_${tab} #control_tab_params`)?.click());
}
addContextMenuEventListener();
}