Commit / контролируемый переход
@@ -301,6 +303,7 @@diff --git a/cmd/creator-web/static/assets/console.css b/cmd/creator-web/static/assets/console.css index b3234d2..008a05d 100644 --- a/cmd/creator-web/static/assets/console.css +++ b/cmd/creator-web/static/assets/console.css @@ -94,6 +94,10 @@ button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus- .context-input-row input { min-width: 0; } .copy-context { width: 34px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: transparent; cursor: pointer; } .copy-context:hover { color: var(--ink); border-color: var(--faint); background: var(--panel-high); } +.id-actions { min-height: 31px; display: flex; align-items: center; gap: 7px; margin-top: 12px; } +.id-action { min-height: 30px; padding: 0 9px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--muted); background: transparent; cursor: pointer; font: 9px/1 var(--mono); letter-spacing: .04em; } +.id-action:hover { color: var(--ink); border-color: var(--signal); background: rgba(201,168,95,.07); } +.icon-id-action { width: 30px; padding: 0; color: var(--faint); } .context-form label { margin-top: 15px; } .context-form label:first-child { margin-top: 0; } .context-form input { height: 40px; padding: 0 10px; font: 11px/1 var(--mono); } diff --git a/cmd/creator-web/static/assets/console.js b/cmd/creator-web/static/assets/console.js index 39b339f..b201a79 100644 --- a/cmd/creator-web/static/assets/console.js +++ b/cmd/creator-web/static/assets/console.js @@ -277,6 +277,32 @@ for (const button of document.querySelectorAll("[data-copy-context]")) { }); } +for (const button of document.querySelectorAll("[data-copy-value], [data-use-value]")) { + button.addEventListener("click", async () => { + const source = byId(button.dataset.copyValue || button.dataset.useValue); + const value = source?.textContent.trim() || ""; + if (!value || value === "—") { + notify("Сначала загрузите значение."); + return; + } + if (button.dataset.useValue) { + const target = byId(button.dataset.targetId); + if (!target) return; + target.value = value; + document.querySelector(".advanced-context").open = true; + saveContext(); + notify("ID подставлен в расширенную проверку."); + return; + } + try { + await navigator.clipboard.writeText(value); + notify("ID скопирован."); + } catch (_) { + notify("Не удалось скопировать ID."); + } + }); +} + byId("reset-context").addEventListener("click", () => { contextFields.forEach((id) => { byId(id).value = id === "capability-id" ? "cognitive-proposal" : ""; }); localStorage.removeItem("domovoy.creator.context"); diff --git a/cmd/creator-web/static/index.html b/cmd/creator-web/static/index.html index 1eb313d..942183e 100644 --- a/cmd/creator-web/static/index.html +++ b/cmd/creator-web/static/index.html @@ -249,6 +249,7 @@
Commit / контролируемый переход
@@ -301,6 +303,7 @@