feat(release): v3.26.109 —— 内存/流畅度收敛 + 参考图修复 + 插件 sticky 1.0.10
- 内存:首帧前预热显示缩略图(避免整屏解码原图)、带图节点视口裁剪 240→80、
DISPLAY_THUMB_MAX 640→1024、放大后不再切原图解码(上限 2× 缩略图长边)
- 参考图:修复 url 引用对象未解析导致的 [object Object] 破图;失效图改为明确占位(双击重新导入)
- 新增 {__cache}→{__blob} 迁移(只迁移可读字节,读不到不动)
- 图片节点按图片比例收边、内边距收窄
- 诊断:帧时长探针(正式包默认关闭,IWB_PERF_PROBE=1 才启用)、edge-drop 换板误报过滤、缓存计数
- 插件 sticky 1.0.10:移除左侧栏面板
This commit is contained in:
1 parent
5ed1172064
commit
24eb1b69c9
23 files changed
+595
-193
No files matched your search
@@ -12,7 +12,7 @@
|
||||
|
||||
function useBootLoad(ctx) {
|
||||
React.useEffect(() => {
|
||||
const { APP_VERSION, CanvasStore, CrashLog, RuntimeMetrics, RuntimeRecovery, W_PURGE_ORIG_FLAG, activeWsIdRef, api, commitCanvas, displayThumbs, doFit, historySnapshotBytes, historyStore, hydrateAndReload, loadDemo, loadSavedGroups, lsGet, lsRawGet, lsRawSet, lsRemove, lsSet, migrateGenTaskIds, normalizeEdges, normalizeGroups, normalizeNodes, openTab, openTabsRef, outThumbCache, refreshOutputs, refs, setActiveWsId, setConfig, setLoaded, setMemUi, setPromptGroups, setPrompts, setResumePrompt, setServer, setWorkspaces, setWsRev, showToast, wDiagStats, wEvictLoadedBoards, wLoadedBoards, wMemoryComposition, wPurgeOutputOriginals, wSafeCompressStart } = ctx()
|
||||
const { APP_VERSION, CanvasStore, CrashLog, RuntimeMetrics, RuntimeRecovery, W_PURGE_ORIG_FLAG, activeWsIdRef, api, commitCanvas, displayThumbs, doFit, historySnapshotBytes, historyStore, hydrateAndReload, loadDemo, loadSavedGroups, lsGet, lsRawGet, lsRawSet, lsRemove, lsSet, migrateGenTaskIds, normalizeEdges, normalizeGroups, normalizeNodes, openTab, openTabsRef, outThumbCache, refreshOutputs, refs, setActiveWsId, setConfig, setLoaded, setMemUi, setPromptGroups, setPrompts, setResumePrompt, setServer, setWorkspaces, setWsRev, showToast, wDiagStats, wEvictLoadedBoards, wLoadedBoards, wMemoryComposition, wPreloadDisplayThumbs, wPurgeOutputOriginals, wSafeCompressStart } = ctx()
|
||||
// 数据永久保留:一次性把当前工作台存储备份为 legacy;若主数据缺失/损坏且存在 legacy 则恢复
|
||||
try {
|
||||
const cur = lsRawGet('iwb_web_workspaces', null)
|
||||
@@ -39,6 +39,21 @@
|
||||
}
|
||||
}).catch(() => {})
|
||||
loadSavedGroups()
|
||||
// 启动内存探针(2026-11-29):状态栏那个数只反映 JS 堆(performance.memory),
|
||||
// 解码位图 / 合成层 / 原生侧完全不算在内,所以和活动监视器差很多是正常的。
|
||||
// 这里把「各结构 MB + DOM 里的 img 个数 + 堆」写进 _boot.log,重启一次就能看出是哪一块在涨。
|
||||
const wBootMemLog = (tag) => {
|
||||
try {
|
||||
const S = (typeof window !== 'undefined') ? window.IWBStorageFile : null
|
||||
if (!S || typeof S.logLine !== 'function') return
|
||||
const pm = (typeof performance !== 'undefined' && performance.memory) ? performance.memory : null
|
||||
const heap = pm ? Math.round(pm.usedJSHeapSize / 1048576) : -1
|
||||
let comp = {}
|
||||
try { comp = (typeof wMemoryComposition === 'function') ? wMemoryComposition(refs) : {} } catch (e) { comp = { err: 1 } }
|
||||
const domImgs = (typeof document !== 'undefined' && document.images) ? document.images.length : -1
|
||||
S.logLine('mem ' + tag + ' heap=' + heap + 'MB domImgs=' + domImgs + ' ' + JSON.stringify(comp))
|
||||
} catch (e) { /* 诊断失败不影响启动 */ }
|
||||
}
|
||||
// 跨标签页节点组同步:本 tab 保存 → 其他 tab 立即刷新(storage 事件 + BroadcastChannel 兜底)
|
||||
const onGsStorage = (e) => {
|
||||
if (e.key === 'iwb_web_groups' || e.key === 'iwb_web_groupgroups') loadSavedGroups()
|
||||
@@ -47,6 +62,9 @@
|
||||
let gsBC = null
|
||||
try { if (typeof BroadcastChannel !== 'undefined') { gsBC = new BroadcastChannel('iwb_groups_sync'); gsBC.onmessage = () => loadSavedGroups() } } catch (err) { /* ignore */ }
|
||||
refreshOutputs(100)
|
||||
wBootMemLog('after-refreshOutputs')
|
||||
// 启动 2 秒后再采一次:此时画板已渲染、DOM 里的 img 才是真实峰值
|
||||
setTimeout(() => wBootMemLog('ready-2s'), 2000)
|
||||
// 初始化超时兜底:本地工作台读取异常/挂起时,保证进入已加载界面,避免 splash 一直转圈。
|
||||
let wsLoadTimer = null
|
||||
const ensureLoaded = () => {
|
||||
@@ -62,6 +80,7 @@
|
||||
setWsRev(r.rev || null)
|
||||
try { const F = window.IWBImageFileRef; if (F && F.grantKnown) await F.grantKnown(r.workspaces) } catch (e) { /* 授权失败:相册/组合按缺图提示 */ }
|
||||
setWorkspaces(r.workspaces.map((w) => ({ ...w, nodes: w.nodes || [], edges: w.edges || [], groups: w.groups || [] })))
|
||||
wBootMemLog('after-workspaces')
|
||||
// 上次生成中断(24 小时内)→ 提示可续跑(已完成的结果已持久化,不重跑)
|
||||
try {
|
||||
const rr = lsGet('iwb_web_running', null)
|
||||
@@ -99,6 +118,11 @@
|
||||
try { savedActive = lsRawGet('iwb_ws_active', null) } catch (e) { /* ignore */ }
|
||||
const active = r.workspaces.find((w) => w.id === savedActive) || r.workspaces.find((w) => w.id === r.activeId) || r.workspaces[0]
|
||||
setActiveWsId(active.id); openTab(active.id) // S12:初始活动画布也进标签列表
|
||||
// v3.26.109(内存 D):首帧前先把显示缩略图准备好。
|
||||
// 原来 loadWsInto 用 setTimeout(0) 预热 ⇒ 第一帧就已经用**原图**解码(实测 WebContent 峰值 2.6G),
|
||||
// 缩略图晚到也只是换 src,解码过的原图仍被 WebKit 留着。改成渲染前 await。
|
||||
try { await wPreloadDisplayThumbs(active.nodes) } catch (e) { /* 预热失败照常启动 */ }
|
||||
wBootMemLog('after-thumbs')
|
||||
const ns = normalizeNodes(active.nodes)
|
||||
if (ns.length) {
|
||||
const es0 = normalizeEdges(active.edges)
|
||||
|
||||
Reference in new issue
Block a user