diff --git a/panel.js b/panel.js index bf787ad..90c92ad 100644 --- a/panel.js +++ b/panel.js @@ -3068,16 +3068,6 @@ function _handleTaskProfileWorkspaceInput(event) { const target = event.target; if (!(target instanceof HTMLElement)) return; - if (target.id === "bme-task-profile-name") { - _updateCurrentTaskProfile( - (draft) => { - draft.name = String(target.value || "").trim() || draft.name; - }, - { refresh: false }, - ); - return; - } - if (target.matches("[data-block-field]")) { _persistSelectedBlockField(target, false); return; @@ -3556,14 +3546,16 @@ async function _handleTaskProfileWorkspaceClick(event) { toastr.success("当前预设已保存", "ST-BME"); return; case "rename-profile": { - const nameInput = document.getElementById("bme-task-profile-name"); - const nextName = String(nameInput?.value || "").trim(); - if (!nextName) { + const current = String(selectedProfile?.name || "").trim(); + const nextName = window.prompt("请输入预设名称", current); + if (nextName == null) return; + const trimmed = String(nextName).trim(); + if (!trimmed) { toastr.info("预设名称不能为空", "ST-BME"); return; } _updateCurrentTaskProfile((draft) => { - draft.name = nextName; + draft.name = trimmed; }); toastr.success("预设名称已更新", "ST-BME"); return; @@ -3712,13 +3704,15 @@ function _renderTaskProfileWorkspace(state) {
-
-
${_escHtml(taskMeta?.label || state.taskType)}
- - + ${state.bucket.profiles + .map( + (profile) => `
- -
-
-
- + ) + .join("")} +
${state.profile.builtin ? "内置" : "自定义"} diff --git a/style.css b/style.css index 7164aee..cfe673d 100644 --- a/style.css +++ b/style.css @@ -1312,7 +1312,7 @@ #st-bme-panel input.bme-search-input, #st-bme-panel .bme-node-detail-input, #st-bme-panel .bme-node-detail-textarea, -#st-bme-panel .bme-task-editor-name-input { +#st-bme-panel .bme-task-editor-preset-select { background-color: var(--bme-surface-high) !important; color: var(--bme-on-surface) !important; } @@ -1916,41 +1916,38 @@ background: var(--bme-surface-container); } -/* 左栏:紧凑「任务 + 下拉」切换预设,避免大块列表卡片占宽 */ -.bme-task-profile-nav { - width: 168px; - flex-shrink: 0; - border-right: 1px solid var(--bme-border); - display: flex; - flex-direction: column; - gap: 6px; - padding: 10px 10px 12px; - background: var(--bme-surface); +.bme-visually-hidden { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; } -.bme-task-profile-nav-kicker { +.bme-task-editor-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bme-on-surface-dim); line-height: 1.2; - word-break: break-all; } -.bme-task-profile-nav-label { - font-size: 11px; +.bme-task-editor-preset-select { + flex: 1; + min-width: 200px; + min-height: 40px; + font-size: 16px; font-weight: 600; - color: var(--bme-on-surface-dim); - margin: 2px 0 0; -} - -.bme-task-profile-nav-select { - width: 100%; - min-height: 32px; - font-size: 12px; - padding: 4px 28px 4px 8px; + padding: 6px 32px 6px 12px; line-height: 1.35; + border-radius: 8px; + border: 1px solid var(--bme-border); + cursor: pointer; } .bme-task-profile-editor { @@ -1976,28 +1973,10 @@ flex-wrap: wrap; } -.bme-task-editor-name-input { - flex: 1; - min-width: 200px; - font-size: 16px; - font-weight: 600; - padding: 6px 10px; - border-radius: 8px; - border: 1px solid transparent; - background: transparent; - color: var(--bme-on-surface); - transition: border-color 0.15s, background 0.15s; -} - -.bme-task-editor-name-input:hover { - border-color: var(--bme-border); - background: var(--bme-surface-high); -} - -.bme-task-editor-name-input:focus { - outline: none; +.bme-task-editor-preset-select:hover, +.bme-task-editor-preset-select:focus { border-color: var(--bme-primary); - background: var(--bme-surface-high); + outline: none; } .bme-task-editor-actions { @@ -4064,31 +4043,19 @@ min-height: auto; } - .bme-task-profile-nav { + .bme-task-editor-preset-select { + min-width: 0; width: 100%; - border-right: none; - border-bottom: 1px solid var(--bme-border); - flex-direction: row; - flex-wrap: wrap; - align-items: flex-end; - gap: 8px 12px; - padding: 10px 12px; + flex: 1 1 100%; } - .bme-task-profile-nav-kicker { - width: 100%; - flex-basis: 100%; + .bme-task-editor-title-row { + flex-direction: column; + align-items: stretch; } - .bme-task-profile-nav-label { - flex: 0 0 auto; - margin: 0; - align-self: center; - } - - .bme-task-profile-nav-select { - flex: 1; - min-width: 140px; + .bme-task-profile-badges { + justify-content: flex-start; } .bme-task-segmented-control {