feat(canvas): 气泡解组只移出当前节点;画布卡片补强选中态(新增设计 token)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m10s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m10s
1) 节点气泡「解组」语义调整(用户反馈): 原实现解散整个节点组。现在只把**当前选中节点**移出组: - src/runtime-workbench-logic.js 新增 ungroupNode(nid):组内剩 ≥2 个 → 只改成员;剩 1 个 → 组自动解散; 组 id / 名字保持不变,并显式 saveNow 立即落盘。 - app.js 单选气泡按钮改调 ungroupNode(sn.id),提示文案改为「移出节点组」; 多选气泡的「解组」仍是整组解散(语义不同,保持不变)。 2) 画布库卡片选中态(用户反馈:看不出当前选中哪张,易误删): - 原有 .iwb-home-card-selected 只用了 border2(弱描边),且被后面 .iwb-home-card 基础规则按源码顺序覆盖 ⇒ 改为 .iwb-home-card.iwb-home-card-selected(提高优先级,与顺序无关)。 - 新增两个设计 token(单一源 src/theme-tokens.js,生成到 design-tokens.css / tokens.json): · --iwb-sel-surface:选中底色(亮色比卡片略深、暗色比面板略亮) · --iwb-sel-ring:选中描边(由文字色派生:亮色压深 12%、暗色提亮 18%,品牌色为中性灰时也能拉开) - 实测(1440×1000,亮色):未选中 bc #c2c2c2 / bg #fefefe → 选中 bc #383838 / bg #eff0f1 + 2px 外环。 门禁:tokens:check / token-ratchet / theme-contrast(138 对) / verify:ci 全绿(含 e2e 冒烟 31 条)。
This commit is contained in:
1 parent
2cd52d1d4e
commit
e91618603c
9 files changed
+38
-12
No files matched your search
@@ -1888,6 +1888,20 @@
|
||||
const nextGroups = refs.groups.filter((g) => g.id !== gid)
|
||||
commitCanvas(undefined, undefined, nextGroups)
|
||||
}
|
||||
// v3.26.109:把**单个节点**移出所在组(气泡上的「解组」原先是整组解散)。
|
||||
// 组内剩 2 个及以上 ⇒ 只改成员;只剩 1 个 ⇒ 组没有意义,直接解散。
|
||||
const ungroupNode = (nid) => {
|
||||
const g = refs.groups.find((x) => x && Array.isArray(x.memberIds) && x.memberIds.includes(nid))
|
||||
if (!g) return false
|
||||
const rest = g.memberIds.filter((id) => id !== nid)
|
||||
pushHistory()
|
||||
const nextGroups = refs.groups.filter((x) => x.id !== g.id)
|
||||
if (rest.length >= 2) nextGroups.push(Object.assign({}, g, { memberIds: rest })) // 保留组 id/名字/留白
|
||||
commitCanvas(undefined, undefined, nextGroups)
|
||||
saveNow({ nodes: refs.nodes, edges: refs.edges, groups: nextGroups }) // 组变更立刻落盘
|
||||
setNotice({ type: 'ok', text: rest.length >= 2 ? '已把该节点移出节点组' : '节点组只剩 1 个节点,已自动解散' })
|
||||
return true
|
||||
}
|
||||
const joinGroupOf = (nid) => joinGroupOfCore({ pushHistory, commitCanvas, refs, setNotice }, nid) // 逻辑在 src/runtime-workbench-logic.js
|
||||
// 重命名节点组(双击操作栏组名 → 就地编辑)。空名不生效,保持原名,避免出现无名组。
|
||||
const renameGroup = (gid, name) => {
|
||||
@@ -2219,7 +2233,7 @@
|
||||
setViewport(next)
|
||||
}
|
||||
|
||||
return { historyStore, HISTORY_IMG_REF_FIELDS, historyRefUsable, historyRefData, historyRawSnapshot, pushHistory, pushHistoryDebounced, restore, undo, redo, UNDO_KEYS, updateNode, clearGenResults, deleteNodes, deleteEdge, copyOffset, duplicateNodes, floatbarRefPaste, outResultUrls, stageClip, copyNodes, pasteGraph, readClipboardGraph, pasteCopiedNodes, clearClipboard, cutNodes, groupOf, makeGroup, ungroup, joinGroupOf, renameGroup, duplicateGroup, saveGroupSnapshot, saveSelectionAsGroup, instantiateGroup, loadSavedGroups, findSpot, placeAtDrop, addNode, addPluginNode, addRefFromUrl, refSrcOf, refreshOutputs, deleteOutputs, loadDemo, doFit }
|
||||
return { historyStore, HISTORY_IMG_REF_FIELDS, historyRefUsable, historyRefData, historyRawSnapshot, pushHistory, pushHistoryDebounced, restore, undo, redo, UNDO_KEYS, updateNode, clearGenResults, deleteNodes, deleteEdge, copyOffset, duplicateNodes, floatbarRefPaste, outResultUrls, stageClip, copyNodes, pasteGraph, readClipboardGraph, pasteCopiedNodes, clearClipboard, cutNodes, groupOf, makeGroup, ungroup, ungroupNode, joinGroupOf, renameGroup, duplicateGroup, saveGroupSnapshot, saveSelectionAsGroup, instantiateGroup, loadSavedGroups, findSpot, placeAtDrop, addNode, addPluginNode, addRefFromUrl, refSrcOf, refreshOutputs, deleteOutputs, loadDemo, doFit }
|
||||
}
|
||||
// ── createWorkbenchSessions(2026-11-06 从 Workbench 外移;行为逐字保留)──────────────
|
||||
function createWorkbenchSessions(ctx) {
|
||||
|
||||
Reference in new issue
Block a user