Files
image-workbench-desktop/package.json
T
qiqi 383b28cc77 fix(canvas-webview)!: 恢复画布内网页,修好「一动就白 / 只有某个缩放比例能看」
推翻 v3.25.27 的「下线」判断。用户补充的现象是决定性的:
不动时有内容,移动/缩放节点/缩放画布之后就没了,只有某个缩放区间能看。
这不是平台随机失效,而是我们两个策略的必然结果:

1) 「动就藏」——单帧位移/尺寸变化 > 18px 就判定拖动并隐藏,停 140ms 再显示。
   缩放画布与拖缩放手柄都在阈值之上 ⇒ 一动就藏。
2) 「< 64x48 就隐藏」——画布缩小后节点必然变小 ⇒ 只有某个缩放比例能看见
   (正是用户说的「某一个画布缩放大小时显示」)。

最小 Tauri 工程逐帧截图证明平台是安全的:子 webview 连续 60 帧改尺寸、
1x1 极值、连续移动、移出窗口再移回,全都不白。问题全在调度策略。

改动:
- 取消「动就藏」:移动/拖动/缩放全程可见;只有画布切走、模态遮罩、
  交集 < 2px 三种情况才隐藏
- 取消尺寸门槛:交集 >= 2px 就显示
- 位置+尺寸用一次 set_bounds 推送(替代 set_size + set_position 两条消息,
  两条之间有「新尺寸+旧位置」的中间态,是白屏的另一个来源)
- 仍永不 show()/hide()(macOS 上 hide 后 show 静默失效),隐藏 = 停到窗口外
- 位置随时跟(节流 40ms),尺寸静止 120ms 后再推
- 保留自诊断:Err 原文写进节点 + 重试、15s 加载超时提示、_cwv.log

本机真实应用实测:三个节点(baidu/huaban×2)全部出页面,窗口从 3228x2418
缩到 1180x760 后仍在且正常重排。

版本 3.25.28
2026-11-19 06:44:53 +08:00

46 lines
5.7 KiB
JSON

{
"name": "image-workbench-web",
"private": true,
"version": "3.25.28",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
"tauri": "tauri",
"app:dev": "tauri dev",
"app:build": "tauri build",
"lint": "eslint src app.js",
"test": "node tests/relay-task-graph-fixture-test.js && node tests/plugin-style-node-test.js && node tests/inherit-text-test.js",
"test:unit": "node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/ui-groups-sidebar-test.js && node tests/ui-lib-sidebar-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-workbench-hooks-test.js",
"test:diagnostics": "node tests/runtime-diagnostics-hotpath-test.js",
"test:facts": "node tests/architecture-facts-guard-test.js && node tests/release-records-test.js",
"plugins:gc": "node scripts/plugins-publish.mjs --gc",
"coverage:browser": "npm run build && node scripts/coverage-browser.js",
"audit:pins": "node scripts/audit-source-pins.js",
"test:e2e": "npm run build && node scripts/serve-test.js",
"test:e2e:local": "node scripts/serve-test.js",
"verify:ci": "npm run build && node --check app.js && node --check dist/app.js && node scripts/check-dist.js && npm run lint && npm run typecheck && npm run test:unit && npm test && npm run test:facts",
"verify": "npm run verify:ci && npm run test:e2e",
"verify:release": "node scripts/verify-release.js",
"coverage:e2e": "node scripts/coverage-e2e.js",
"sync:facts": "node scripts/sync-facts.js",
"sync:facts:write": "node scripts/sync-facts.js --write",
"typecheck": "tsc -p tsconfig.json",
"release:desktop": "bash scripts/release.sh"
},
"devDependencies": {
"@playwright/test": "^1.64.1",
"@tauri-apps/cli": "^2.12.4",
"esbuild": "0.28.2",
"eslint": "^10.13.0",
"globals": "^17.13.0",
"jsdom": "^24.1.3",
"playwright": "^1.64.1",
"typescript": "^5.9.3"
},
"dependencies": {
"@tauri-apps/plugin-dialog": "^2.8.4",
"@tauri-apps/plugin-fs": "^2.7.1",
"@tauri-apps/plugin-http": "^2.9.0"
}
}