mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
refactor(task-preset): 左栏改为紧凑下拉切换预设,释放编辑区空间
Made-with: Cursor
This commit is contained in:
42
panel.js
42
panel.js
@@ -3489,21 +3489,6 @@ async function _handleTaskProfileWorkspaceClick(event) {
|
||||
actionEl.dataset.taskTab || currentTaskProfileTabId;
|
||||
_refreshTaskProfileWorkspace();
|
||||
return;
|
||||
case "select-profile": {
|
||||
const profileId = actionEl.dataset.profileId;
|
||||
if (profileId) {
|
||||
const settings = _getSettings?.() || {};
|
||||
const nextTaskProfiles = setActiveTaskProfileId(
|
||||
settings.taskProfiles || {},
|
||||
currentTaskProfileTaskType,
|
||||
profileId,
|
||||
);
|
||||
currentTaskProfileBlockId = "";
|
||||
currentTaskProfileRuleId = "";
|
||||
_patchTaskProfiles(nextTaskProfiles);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case "refresh-task-debug":
|
||||
if (typeof _getRuntimeDebugSnapshot === "function") {
|
||||
_getRuntimeDebugSnapshot({ refreshHost: true });
|
||||
@@ -3727,11 +3712,10 @@ function _renderTaskProfileWorkspace(state) {
|
||||
</div>
|
||||
|
||||
<div class="bme-task-master-detail">
|
||||
<div class="bme-task-profile-list">
|
||||
<div class="bme-task-profile-list-header">
|
||||
<span>${_escHtml(taskMeta?.label || state.taskType)}</span>
|
||||
</div>
|
||||
<select id="bme-task-profile-select" class="bme-config-input" style="display:none">
|
||||
<div class="bme-task-profile-nav" aria-label="任务预设切换">
|
||||
<div class="bme-task-profile-nav-kicker">${_escHtml(taskMeta?.label || state.taskType)}</div>
|
||||
<label class="bme-task-profile-nav-label" for="bme-task-profile-select">当前预设</label>
|
||||
<select id="bme-task-profile-select" class="bme-config-input bme-task-profile-nav-select">
|
||||
${state.bucket.profiles
|
||||
.map(
|
||||
(profile) => `
|
||||
@@ -3739,28 +3723,12 @@ function _renderTaskProfileWorkspace(state) {
|
||||
value="${_escAttr(profile.id)}"
|
||||
${profile.id === state.profile.id ? "selected" : ""}
|
||||
>
|
||||
${_escHtml(profile.name)}${profile.builtin ? " · 内置" : ""}
|
||||
${_escHtml(profile.name)}${profile.builtin ? "(内置)" : ""}
|
||||
</option>
|
||||
`,
|
||||
)
|
||||
.join("")}
|
||||
</select>
|
||||
<div class="bme-task-profile-items">
|
||||
${state.bucket.profiles
|
||||
.map(
|
||||
(profile) => `
|
||||
<div
|
||||
class="bme-task-profile-list-item ${profile.id === state.profile.id ? "active" : ""}"
|
||||
data-task-action="select-profile"
|
||||
data-profile-id="${_escAttr(profile.id)}"
|
||||
>
|
||||
<div class="bme-task-profile-list-item-name">${_escHtml(profile.name)}</div>
|
||||
${profile.builtin ? '<span class="bme-task-pill is-builtin">内置</span>' : ""}
|
||||
</div>
|
||||
`,
|
||||
)
|
||||
.join("")}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bme-task-profile-editor">
|
||||
|
||||
101
style.css
101
style.css
@@ -1916,64 +1916,41 @@
|
||||
background: var(--bme-surface-container);
|
||||
}
|
||||
|
||||
.bme-task-profile-list {
|
||||
width: 220px;
|
||||
/* 左栏:紧凑「任务 + 下拉」切换预设,避免大块列表卡片占宽 */
|
||||
.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-task-profile-list-header {
|
||||
padding: 14px 16px 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--bme-on-surface-dim);
|
||||
border-bottom: 1px solid var(--bme-border);
|
||||
}
|
||||
|
||||
.bme-task-profile-items {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.bme-task-profile-list-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
font-size: 13px;
|
||||
color: var(--bme-on-surface-dim);
|
||||
}
|
||||
|
||||
.bme-task-profile-list-item:hover {
|
||||
background: var(--bme-surface-high);
|
||||
}
|
||||
|
||||
.bme-task-profile-list-item.active {
|
||||
background: var(--bme-primary-dim);
|
||||
color: var(--bme-primary);
|
||||
border-left: 3px solid var(--bme-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.bme-task-profile-list-item-name {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bme-task-profile-list-item .bme-task-pill {
|
||||
.bme-task-profile-nav-kicker {
|
||||
font-size: 10px;
|
||||
padding: 2px 6px;
|
||||
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;
|
||||
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;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.bme-task-profile-editor {
|
||||
@@ -4087,11 +4064,31 @@
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.bme-task-profile-list {
|
||||
.bme-task-profile-nav {
|
||||
width: 100%;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--bme-border);
|
||||
max-height: 200px;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
gap: 8px 12px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.bme-task-profile-nav-kicker {
|
||||
width: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
.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-segmented-control {
|
||||
|
||||
Reference in New Issue
Block a user