diff --git a/CHANGELOG.md b/CHANGELOG.md index 78cff85..7684a25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,19 @@ > 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。 > 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。 +## v3.25.36(2026-11-19)停靠栏置顶、折叠按钮归位、顶部功能图标上移 + +**界面修正(按用户截图反馈)** +- 左右停靠栏改为**从窗口最顶端开始**(`top: 0`),消除顶栏上方那条“缺口”;标签条与画布状态行改为随侧栏宽度内缩(`left/right = --iwb-dock-l/--iwb-dock-r`),标题跟着缩进。 +- 左栏折叠图标从头部最左移到**头部最右**(贴近画布);右栏折叠图标保持在面板最右(贴近窗口)。 +- 折叠后各自在窗口边缘保留 **14px 窄条 + 展开图标**(左折叠时标题自动左移贴到窄条右侧,右折叠时右侧只留一个图标条)。 +- 画布仍 `inset:0` 不位移;底部工具栏/小地图继续按 `--iwb-dock-*` 让位。 + +**顶部图标** +- 原画布状态行右侧的功能图标(主题 / 设置 / 图库 / 更多)**上移到画布标签条最右**;保存按钮去掉(自动保存,状态行仍有“保存成功”)。 + +**未验证**:Windows/Linux 与插件网页面板停靠表现需真机实测。 + ## v3.25.35(2026-11-19)左右停靠栏(P1 布局 + P2 图标拖拽),图库独立右栏 **新增布局** diff --git a/app.js b/app.js index ac7c023..caff2fc 100644 --- a/app.js +++ b/app.js @@ -5466,6 +5466,7 @@ const tbCenterSeed = (type, refs) => { // 组件已收编到 src/ui-lib-sidebar.js(P2-9 组件抽取);宿主注入应用层助手 const LibSidebar = (props) => window.IWBUILibSidebar(Object.assign({ I, api, uid, useTextDialog, TextDialog, promptGroupsOf, PluginHost, wPluginPanels }, props)) const DockArea = (typeof window !== 'undefined') ? window.IWBDockArea : null + const TopActions = (typeof window !== 'undefined') ? window.IWBUICanvasTopActions : null // 画布标签条(阶段一组件化 2026-11-07):纯展示组件,回调与快照值经 props 注入 const WorkspaceTabs = (props) => window.IWBUIWorkspaceTabs(Object.assign({ I }, props)) // 应用外壳 UI(阶段一组件化):画布顶栏 / 产品导航,纯展示 @@ -7989,7 +7990,9 @@ const tbCenterSeed = (type, refs) => { // 方案A:每对标签之间一条同款竖线分隔(.iwb-tab-sep,与首页线同规格) // 先过滤失效 id:标签若为空洞(已删画板)会跳过渲染,避免出现相邻双线 const tabIds = WorkspaceList.liveTabIds(workspaces, openTabs) + const topActionsEl = TopActions ? el(TopActions, { I, theme, toggleTheme, setSettingOpen, drawerOpen, setDrawerOpen, setDrawerTab, setWsMorePos, setWsMoreOpen }) : null const tabstripEl = el(WorkspaceTabs, { + actions: topActionsEl, tabIds, workspaces, activeWsId, diff --git a/package.json b/package.json index 41203f8..223d45c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "image-workbench-web", "private": true, - "version": "3.25.35", + "version": "3.25.36", "description": "Browser-based node canvas image workbench", "scripts": { "build": "node scripts/build.js && node scripts/copy-plugins.js", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index d41fb4e..d8e79f0 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1983,7 +1983,7 @@ dependencies = [ [[package]] name = "image-workbench" -version = "3.25.35" +version = "3.25.36" dependencies = [ "arboard", "base64 0.22.1", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d5deaa3..6decbc8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "image-workbench" -version = "3.25.35" +version = "3.25.36" description = "无限画布 · 生图工作台桌面版" authors = ["malongan"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d1709d4..0a69964 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "image-workbench", - "version": "3.25.35", + "version": "3.25.36", "identifier": "com.malongan.imageworkbench", "build": { "frontendDist": "../dist", diff --git a/src/ui-app-chrome.js b/src/ui-app-chrome.js index a1e8eaa..4d14573 100644 --- a/src/ui-app-chrome.js +++ b/src/ui-app-chrome.js @@ -75,11 +75,24 @@ })(), ), el('span', { className: 'iwb-top-nav-spacer' }, null), - // v3.1.0:「我的画布」调色板图标已删(回首页走标签条房子图标,双入口冗余) + ) + } + + // 顶部功能图标组:已移到标签条最右(v3.25.36),保存按钮去掉(自动保存) + function IWBUICanvasTopActions (props) { + const I = props.I + const theme = props.theme + const toggleTheme = props.toggleTheme + const setSettingOpen = props.setSettingOpen + const drawerOpen = props.drawerOpen + const setDrawerOpen = props.setDrawerOpen + const setDrawerTab = props.setDrawerTab + const setWsMorePos = props.setWsMorePos + const setWsMoreOpen = props.setWsMoreOpen + return el('div', { className: 'iwb-tab-actions' }, el('button', { className: 'iwb-top-nav-icon', title: '切换主题样式', onClick: toggleTheme }, theme === 'dark' ? I('sun') : I('moon')), el('button', { className: 'iwb-top-nav-icon', title: '服务与 Key 设置', onClick: () => setSettingOpen(true) }, I('settings')), - el('button', { className: 'iwb-top-nav-icon', title: '保存当前画布', onClick: () => { saveNow(); showToast('已保存当前画布') } }, I('save')), - el('button', { className: 'iwb-top-nav-icon' + (drawerOpen ? ' iwb-top-nav-icon-active' : ''), title: '资源中心(提示词库/节点组/图库)', onClick: () => { const nv = !drawerOpen; setDrawerOpen(nv); if (nv) setDrawerTab('prompts') } }, I('panel')), + el('button', { className: 'iwb-top-nav-icon' + (drawerOpen ? ' iwb-top-nav-icon-active' : ''), title: '图库(右侧栏)', onClick: () => { const nv = !drawerOpen; setDrawerOpen(nv); if (nv) setDrawerTab('history') } }, I('panel')), el('button', { className: 'iwb-top-nav-icon', title: '更多操作', onClick: (e) => { const r = e.currentTarget.getBoundingClientRect(); setWsMorePos({ top: r.bottom + 6, left: Math.max(6, r.right - 210) }); setWsMoreOpen((v) => !v) } }, I('more')), ) } @@ -105,5 +118,6 @@ } global.IWBUICanvasTopBar = IWBUICanvasTopBar + global.IWBUICanvasTopActions = IWBUICanvasTopActions global.IWBUIProductNav = IWBUIProductNav })(typeof window !== 'undefined' ? window : globalThis) diff --git a/src/ui-dock.js b/src/ui-dock.js index 3a462f0..45e2f38 100644 --- a/src/ui-dock.js +++ b/src/ui-dock.js @@ -301,7 +301,8 @@ onClick: function (e) { e.stopPropagation(); if (!dragRef.current) setSide(side, { active: id }) }, }, renderIcon((p && p.icon) || 'panel')) }) - return el('div', { className: 'iwb-dock-head' }, isLeft ? [toggleBtn].concat(icons) : icons.concat([toggleBtn])) + // 折叠图标统一放在面板头部最右(贴近画布/窗口边缘) + return el('div', { className: 'iwb-dock-head' }, icons.concat([toggleBtn])) } const renderBody = function (side) { diff --git a/src/ui-workspace-tabs.js b/src/ui-workspace-tabs.js index 415d5bd..806606d 100644 --- a/src/ui-workspace-tabs.js +++ b/src/ui-workspace-tabs.js @@ -70,7 +70,9 @@ // 画布标签组与「+ 新建」分隔(0 个标签时不加,避免与首页线叠成双线) tabIds.length ? el('span', { key: '__sep-new__', className: 'iwb-tab-sep', 'aria-hidden': 'true' }, null) : null, // + 新建 - el('button', { className: 'iwb-tab iwb-tab-new', title: '新建画布', onClick: () => newWs() }, '+') + el('button', { className: 'iwb-tab iwb-tab-new', title: '新建画布', onClick: () => newWs() }, '+'), + el('span', { className: 'iwb-tab-spacer' }, null), + props.actions || null ) } diff --git a/style.css b/style.css index 2f74dc1..cdcb95b 100644 --- a/style.css +++ b/style.css @@ -2123,7 +2123,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s /* ===== 左右停靠栏(v3.25.35,Obsidian 式) ===== * 画布始终 inset:0 不动;只有工具栏/小地图/提示条按 --iwb-dock-l/--iwb-dock-r 让位。 */ -.iwb-dockarea { position: absolute; left: 0; right: 0; bottom: 0; top: var(--iwb-dock-top, 92px); z-index: 24; pointer-events: none; } +.iwb-dockarea { position: absolute; left: 0; right: 0; bottom: 0; top: 0; z-index: 24; pointer-events: none; } .iwb-dock { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; background: var(--iwb-panel); pointer-events: auto; min-width: 100px; @@ -2170,6 +2170,12 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s background: var(--iwb-panel); color: var(--iwb-text); border: 1px solid var(--iwb-border2); box-shadow: 0 8px 24px rgba(0,0,0,.18); white-space: nowrap; } +/* 顶栏与标签条随左右栏内缩(标题跟着缩进;画布仍不动) */ +.iwb-canvas-topbar { left: var(--iwb-dock-l, 0px) !important; right: var(--iwb-dock-r, 0px) !important; } +.iwb-tabstrip { left: var(--iwb-dock-l, 0px) !important; right: var(--iwb-dock-r, 0px) !important; } +.iwb-tab-spacer { flex: 1 1 auto; } +.iwb-tab-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; pointer-events: auto; } +.iwb-tab-actions .iwb-top-nav-icon { width: 28px; height: 28px; min-height: 28px; } /* 其它浮层让位(画布不动) */ .iwb-toolbar-wrap { left: var(--iwb-dock-l, 0px); right: calc(60px + var(--iwb-dock-r, 0px)); } .iwb-minimap { right: calc(62px + var(--iwb-dock-r, 0px)); } diff --git a/tests/fixtures/iwb-app-global-reads.json b/tests/fixtures/iwb-app-global-reads.json index d5226cc..d673bde 100644 --- a/tests/fixtures/iwb-app-global-reads.json +++ b/tests/fixtures/iwb-app-global-reads.json @@ -58,6 +58,7 @@ "IWBStorageWorkspace", "IWBStorageZip", "IWBUIBackupModal", + "IWBUICanvasTopActions", "IWBUICanvasTopBar", "IWBUICanvasView", "IWBUIConfirm", diff --git a/tests/left-resource-layout-test.js b/tests/left-resource-layout-test.js index 54f5f30..fc294db 100644 --- a/tests/left-resource-layout-test.js +++ b/tests/left-resource-layout-test.js @@ -15,7 +15,7 @@ const source = uiAllSrc() const css = fs.readFileSync(path.join(__dirname, '..', 'style.css'), 'utf8') assert.ok(source.includes("panels: dockPanels")) assert.ok(source.includes("storageKey: 'iwb.dock.v1'")) -assert.ok(source.includes("title: '资源中心(提示词库/节点组/图库)'")) +assert.ok(source.includes("title: '图库(右侧栏)'")) assert.ok(!source.includes("className: 'iwb-resource-rail'")) assert.ok(!source.includes("className: 'iwb-left-drawer'")) assert.ok(!source.includes("className: 'iwb-canvas-expand'")) diff --git a/tests/page-chrome-regression-test.js b/tests/page-chrome-regression-test.js index 06ee7c2..bd0aec7 100644 --- a/tests/page-chrome-regression-test.js +++ b/tests/page-chrome-regression-test.js @@ -73,7 +73,7 @@ assert.ok(css.includes('.iwb-overlay.drawer-open .iwb-canvas { left: 0 !importan assert.ok(!css.includes('.iwb-left-drawer')) assert.ok(!source.includes("className: 'iwb-resource-rail'")) assert.ok(!source.includes("className: 'iwb-canvas-expand'")) -assert.ok(source.includes("title: '资源中心(提示词库/节点组/图库)'")) +assert.ok(source.includes("title: '图库(右侧栏)'")) assert.ok(css.includes('.iwb-landing-actions .iwb-btn { min-height: 42px;')) assert.ok(css.includes('.iwb-home-card-actions { opacity: 0;')) assert.ok(css.includes('.iwb-home-card.iwb-manage .iwb-home-card-check { display: inline-block; }')) diff --git a/tests/shell-render-behavior-test.js b/tests/shell-render-behavior-test.js index 597faec..bf67a93 100644 --- a/tests/shell-render-behavior-test.js +++ b/tests/shell-render-behavior-test.js @@ -126,8 +126,8 @@ function hasClass(window, cls) { // ── 4. 打开资源中心 ──────────────────────────────────────────────────────── const navBtns = Array.from(window.document.querySelectorAll('.iwb-top-nav-icon')) - const resBtn = navBtns.find((b) => String(b.getAttribute('title') || '').includes('资源中心')) - assert.ok(resBtn, '顶栏应存在「资源中心」入口按钮(title 含「资源中心」)—— 找不到说明入口被改名或移除') + const resBtn = navBtns.find((b) => String(b.getAttribute('title') || '').includes('图库')) + assert.ok(resBtn, '顶栏应存在「图库(右侧栏)」入口按钮(title 含「图库」)—— 找不到说明入口被改名或移除') resBtn.dispatchEvent(new window.MouseEvent('click', { bubbles: true })) await sleep(1800) diff --git a/tests/single-canvas-shell-test.js b/tests/single-canvas-shell-test.js index 5424864..d1ea576 100644 --- a/tests/single-canvas-shell-test.js +++ b/tests/single-canvas-shell-test.js @@ -21,7 +21,7 @@ assert.ok(source.includes("lsRawGet('iwb_shell_view'") && source.includes("lsRaw assert.ok(source.includes("el('span', null, '我的画布')")) assert.ok(!allSrc.includes("'📚 资源中心('")) // 旧标签在全部源码里都不得残留 assert.ok(allSrc.includes("className: 'iwb-res-tabs'")) -assert.ok(allSrc.includes("title: '资源中心(提示词库/节点组/图库)'")) // 组件化后位于 src/ui-app-chrome.js +assert.ok(allSrc.includes("title: '图库(右侧栏)'")) // 组件化后位于 src/ui-app-chrome.js assert.ok(source.includes("panels: dockPanels")) assert.ok(source.includes("groups: { title: '节点组'")) assert.ok(source.includes("gallery: { title: '图库'"))