Commit Graph
870 Commits
Author SHA1 Message Date
qiqi 980633cfb9 chore(release): 3.26.115 Windows 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
2026-11-30 07:15:08 +08:00
qiqi 6a858bb10d chore(release): 3.26.115 mac 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
2026-11-30 07:01:24 +08:00
qiqi cfacf47f73 docs: v3.26.115 基线锚点
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 32s
2026-11-30 07:00:04 +08:00
qiqi 59e591fcb0 fix(memory): hydrate 不再预读全部图片引用(v3.26.115)
114 二次启动验证:after-thumbs 111→10MB(缩略图复用成立),ready-2s 166→172MB 没降 ⇒ 启动固定峰。
根因是 wHydrateWorkspace 对每个引用都 wEnsureImgUrl,111 个各读 1.9MB 成 Uint8Array,GC 来不及收。
改为交给显示层按需解析,只读真正渲染到的节点。
2026-11-30 06:58:02 +08:00
qiqi dae9b8b4a9 docs: 补内存基线与三条不变量(v3.26.114 实测) 2026-11-30 06:52:00 +08:00
qiqi d60103f22e chore(release): 3.26.114 Windows 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 37s
2026-11-30 06:41:35 +08:00
qiqi 0dbdbc46c0 chore(release): 3.26.114 mac 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
2026-11-30 06:31:41 +08:00
qiqi 8233dcb191 docs: v3.26.114 基线锚点
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 39s
2026-11-30 06:30:04 +08:00
qiqi ff3e5bc8df fix(memory): 宫格缩略图 settle 加 3 路并发闸门(v3.26.114)
113 稳态已达标(60s heap 16MB、imgBigN 0、imgDataMB 0.5MB),但 ready-2s 出现 370MB 瞬时峰:
settle() 为每个图库条目把原图读成 dataURL(2~8MB),上百条同时等待 ⇒ 瞬时几百 MB。
加 3 路并发闸门,峰值随并发走而不随条目数走。
2026-11-30 06:28:02 +08:00
qiqi acd1e0fa96 chore(release): 3.26.113 Windows 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m35s
2026-11-29 23:29:58 +08:00
qiqi 596614da9e chore(release): 3.26.113 mac 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m37s
2026-11-29 23:16:55 +08:00
qiqi ffa666f9d6 docs: v3.26.113 基线锚点
Verify (Gitea) / gate (build · unit · facts) (push) Canceled after 1m40s
2026-11-29 23:15:11 +08:00
qiqi 040fb575ff fix(memory): 图库宫格不再渲染原图 base64(v3.26.113)
诊断包实测:111 张 2~8MB 的 data: 图不在画布节点里(无 data-node-id、无 class),而在图库宫格。
链路:thumbFor() → localCopySrcOf()(读原图成 dataURL)→ display() 首帧返回原图。

- gallery-sync.thumbFor 改为 settle():等显示缩略图就绪(最多 3s),超大 dataURL 一律不返回
- wDisplayThumbOf:>512KB dataURL 不作为 img src 返回(null)
2026-11-29 23:13:09 +08:00
qiqi bd08ffd8ef diag(memory): 记录大 data: 图片所属节点(imgBigSample)+ thumbsN 改名 galleryThumbN
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 57s
2026-11-29 22:50:29 +08:00
qiqi 7c14e858eb chore(release): 3.26.112 mac 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m3s
2026-11-29 22:35:22 +08:00
qiqi 6c3973e3e6 docs: v3.26.112 基线锚点
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 54s
2026-11-29 22:33:01 +08:00
qiqi 54f140bb9b fix(memory): 缩略图缓存不再收原图;超大数据视为缺失(v3.26.112)
111 实测 ready-2s 51MB(占位生效),但 30s 涨到 304MB 且 imgDataN=111 / imgDataMB=260MB:
生成失败/降级路径 remember(key, 原图dataURL) 把原图当缩略图缓存,画布于是拿 2.3MB base64 当图显示。

- image-display-thumb:>512KB dataURL 一律不入缩略图缓存(四处 remember 加保护),并记录 thumb-fail 证据
- image-thumb-pick:缓存里是超大 dataURL 时视为缺失 → 占位 + 重新排队
- 内存构成新增 imgBigN / imgMaxKB
2026-11-29 22:30:53 +08:00
qiqi 60cce3ccb1 chore(release): 3.26.111 Windows 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m4s
2026-11-29 22:27:36 +08:00
qiqi 9cbdaf57b8 chore(release): 3.26.111 mac 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m11s
2026-11-29 22:24:03 +08:00
qiqi e51eb9a087 docs: v3.26.111 基线锚点
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m17s
2026-11-29 22:21:36 +08:00
qiqi d94c0c89e4 fix(memory): 缩略图回 640 + 补齐磁盘缺失 + 缺图先占位(v3.26.111)
用户实测 108 约 150MB,110 涨到数倍。对账后是三条叠加:
1) DISPLAY_THUMB_MAX 1024→640(解码内存 ∝ 面积,2.56 倍)
2) wPreloadDisplayThumbs 读不到缩略图时改为排队生成(原来只有渲染到的节点才排队,切走画板永远补不齐)
3) 本地图缺缩略图时先占位不再解原图;远程 http(s) 仍直出;生成并发 2→4
2026-11-29 22:19:34 +08:00
qiqi e7ac0212fb diag(memory): 补 30s/60s 内存采样点 + DOM 图片来源分布(data:/blob:)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m43s
2026-11-29 22:10:42 +08:00
qiqi 371af6f562 chore(release): 3.26.110 Windows 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 55s
2026-11-29 22:05:39 +08:00
qiqi b70f5c763d chore(release): 3.26.110 mac 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m52s
2026-11-29 22:02:31 +08:00
qiqi 081da7b42d docs: v3.26.110 基线锚点
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m3s
2026-11-29 21:54:58 +08:00
qiqi 004227f074 fix(memory): 图片字节冷读加 4 路并发闸门(v3.26.110)
Windows 实测:启动后 usedJSHeapSize 34MB → 440~557MB,而画板数据只有 0.5MB。
根因:首帧渲染时对 111 个图片引用同时发起读盘,每个 1~6MB 读成 Uint8Array 再 copy 进 Blob。
改为 getBlob 冷读 4 路并发(缓存命中不排队),堆峰值随并发走而不随画布图片数走;stats 增加读取并发观测。
2026-11-29 21:52:53 +08:00
qiqi 870508a33f chore(release): 3.26.109 Windows 条目 + 站点重生成
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m26s
2026-11-29 21:18:15 +08:00
qiqi 9ecd2e9176 chore(release): 3.26.109 站点/下载页产物
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m37s
2026-11-29 21:00:29 +08:00
qiqi 5554b3f250 docs: v3.26.109 CHANGELOG 条目 + 架构基线锚点
Verify (Gitea) / gate (build · unit · facts) (push) Canceled after 2s
2026-11-29 20:57:06 +08:00
qiqi 24eb1b69c9 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:移除左侧栏面板
2026-11-29 20:53:16 +08:00
qiqi 5ed1172064 fix(canvas): Esc 不再关闭右侧栏(用户明确要求)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m28s
现象:按 Esc 会把右侧栏(图库/提示词/风格库面板)连同里面的筛选、选中状态一起关掉,误按代价太大。

- src/ui-canvas-pointer.js:cancel 级联里删掉 `if (drawerOpen) setDrawerOpen(false)` 这一档。
  Esc 仍负责:取消拖拽/框选/连线 → 关连线菜单/右键菜单/工作台更多/设置弹窗 → 抓手复位
- 右侧栏仍可用:顶栏按钮 / N 键 / 拖拽分隔条(行为不变)
- tests/iwb-stability.spec.js:新增「Esc 不关闭右栏」用例(不用固定等待,toBeVisible 自带重试)

Tab 切换左右栏的方案已分析过,本次不动。
2026-11-29 13:13:50 +08:00
qiqi 8e9a3b6ded feat(plugins): 新增资料目录插件索引体检/修复脚本 plugins:doctor
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 51s
背景:手工往 <资料目录>/plugins/ 拷文件、没更新同目录 index.json 时,加载器按索引里的旧哈希校验,
报「完整性校验失败(main.js 的 sha256 不符)」(2026-11-29 便利贴 1.0.8 实发)。

- scripts/plugin-index-doctor.js:扫描目录与索引,逐条报告 版本差异 / 哈希不符 / 文件缺失 / 未登记 / 孤儿条目;
  默认只报告(有待修项时非 0 退出),--write 按实际文件重写索引并自动备份 index.json.bak-<时间戳>
- package.json: npm run plugins:doctor(可带资料目录与 --write)
- docs/standards/plugin-source-of-truth.md:命令表补该脚本,排错行的处置改为指向它

用法:
  npm run plugins:doctor                          # 默认扫 ~/Documents/ImageWorkbench
  npm run plugins:doctor -- /path/to/data         # 指定资料目录(只报告)
  npm run plugins:doctor -- /path/to/data --write # 写入修复
2026-11-29 12:48:02 +08:00
qiqi a9b19e67de docs(plugins): 补「手工拷插件文件导致 index.json 哈希不符」的排错行 2026-11-29 12:44:30 +08:00
qiqi 43de3b0054 chore(guard): 发布脚本与 pre-push 都接插件两仓一致性检查
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 49s
- scripts/release.sh、scripts/publish-update.sh:开头加前置门禁(不一致直接退出,不发包不传 NAS),
  末尾加收尾复核(发布过程中若有人手改产物层,这里立刻暴露)
- scripts/git-hooks/pre-push + scripts/install-git-hooks.sh + npm run hooks:install:
  推送桌面仓前自动比对两仓,不一致拒绝推送;源仓不存在时跳过(CI/别人机器不阻塞)
- docs/standards/plugin-source-of-truth.md §4 补「四道关卡」表与钩子安装方法
2026-11-29 12:35:33 +08:00
qiqi fd9575a96e chore(plugins): 两仓同步 + 一致性守卫 + 插件规范(gallery 1.9.6 / promptlib 1.14.9 / sticky 1.0.8)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m0s
插件源码改回源仓(iwb-plugins-desktop),桌面仓 plugins/ 只作产物:
- 源仓侧:把 11-28 直接改在产物层的图库/提示词库改动回写为源码;修 validate 的字段扫描(先扫 register 块,
  找不到再回退整份文件,避免被业务代码 id: 'q' 误命中、也兼顾 __IWB_*_MANIFEST__ 构建产物);
  gallery 1.9.6 修「全部重试无效」与「量不到宽度时塌成 1 列」,promptlib 1.14.9
- 本仓侧:node scripts/sync-plugins-from-repo.js 重新生成 plugins/(gallery 1.9.6 / promptlib 1.14.9 / sticky 1.0.8)

新增机制:
- scripts/check-plugins-sync.js:逐插件比对产物与源仓(main.js/styles.css 的 sha256 + manifest/index 版本),
  不一致列出清单并给出修复命令;源仓不存在时跳过(CI/别人机器不阻塞)
- gen-market.js 开头调用该守卫:两仓不一致直接中止,不允许发市场
- package.json: npm run check:plugins
- docs/standards/plugin-source-of-truth.md:两仓职责、目录对照、三条红线、日常流程、应急回写步骤、常见错误对照

验证:源仓 npm run validate 15/15、npm test 全绿;桌面仓 verify:ci 32 passed。
2026-11-29 12:30:01 +08:00
qiqi 7b11c90b0a chore(release): 3.26.108 三平台齐平(windows 条目入 latest.json + 下载页)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m37s
windows 包由 work 机在 0ccc904 构建(5,173,673 B / f55a1305…),mac 侧正式私钥签名后:
- latest-windows.json:version 3.26.108,windows-x86_64 签名 456 字节
- latest.json:合并 windows 条目(合并用「远程文件 + 本地 node」完成,未重跑 publish-update.sh,
  避免重建 mac 产物导致 dmg 字节变化与已登记的 sha256 不符)
  三平台:darwin-aarch64 / darwin-x86_64 / windows-x86_64,顶层 version 3.26.108
- site/releases.json:登记 windows 条目;下载页三行全部 3.26.108;首页/插件页同步刷新
2026-11-28 21:14:36 +08:00
qiqi b7371f6565 fix(site): 下载页按平台取「最近一个有包的版本」,避免三平台分批发布时旧平台变「暂未提供」
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m22s
现象:mac 先发 3.26.108、win 还在构建时,下载页 Windows 行从「3.26.107 下载」变成「暂未提供」——
等于把仍在用的旧版下载入口也关掉了。

原因:gen-release-page 只读 data.releases[0](最新版本)的 platforms,那一版缺少某平台就没有条目。

改动:新增 newestFor(key),逐平台回溯到最近一个真正提供该包的版本,行内版本号用该条目自己的版本;
三平台同批发布时行为不变。
2026-11-28 21:10:46 +08:00
qiqi 2cd5a07b6f chore(release): 3.26.108 发布记录(mac 双架构已上线)+ CHANGELOG 补充
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m7s
- CHANGELOG:3.26.108 追加补充条目(插件升级、滚轮切图、accent token、存储/同步修正、右键菜单精简、strip-plugins 修复)
- site/releases.json:登记 darwin-aarch64 / darwin-x86_64 两个 dmg(size + sha256 + 指纹)
  aarch64 9,531,052 B / 9a7f7f69…;x64 9,940,859 B / a0530cae…

线上状态:latest.json = 3.26.108(两个 darwin 平台,签名已写入),dmg 与 app.tar.gz 均已 200 且大小匹配。
windows 条目等 work 机包到位后,用 publish-windows-update.sh + 重跑 publish-update.sh 合并。
2026-11-28 21:01:37 +08:00
qiqi fabc171f92 docs: 锚点对齐 v3.26.108+af86fa5(publish 自动) 2026-11-28 20:58:49 +08:00
qiqi 0ccc9041d0 fix(promptlib): 1.14.8 给新 token 加兜底,旧客户端也能正常显示
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m34s
1.14.7 直接用 var(--iwb-accent-on-surface) / var(--iwb-accent-tint),但这两个 token 是 3.26.108 才加进客户端的;
3.26.107 及更早的客户端取不到值 → 药丸会变成透明底 + 继承色。

- styles.css:两个 var() 都补上 color-mix 兜底值(与 token 定义一致),新旧客户端视觉一致
2026-11-28 20:56:01 +08:00
qiqi 04cc527002 feat(tokens): 新增 --iwb-accent-on-surface / --iwb-accent-tint 并接入生成链
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m27s
「强调色当文字用」以前各插件各自混色,暗色下对比度不足。现在固化成两个语义 token:

- --iwb-accent-on-surface = color-mix(--iwb-brand 45%, --iwb-text):文字/图标用的安全强调色
- --iwb-accent-tint = color-mix(--iwb-brand 18%, transparent):选中标签/药丸的淡底
  两者都是关系式(跟随主题与自定义强调色),不写死 hex

生成链:scripts/gen-tokens.js 的 LIGHT_ONLY 表 → src/design-tokens.css / dist/tokens.json
(npm run tokens:write 重生成,tokens:check 守卫)

落地:
- plugins/promptlib 1.14.7:参考图药丸改用这两个 token
- style.css:质量档位选中态、右键菜单 hover 底改用这两个 token(顺手去掉两处散落的 12% mix)
- docs/standards/design-tokens.md 新增 §3.9:取值、成对用法、四条规则(填充用 brand / 文字用 accent-on-surface 等)
2026-11-28 20:48:09 +08:00
qiqi 73a56c60f2 fix(promptlib): 1.14.6 强调色当文字用时与正文色混合,修暗色对比度
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m18s
暗色下「封面作参考图 1 张」是 brand 蓝直接压深灰底,对比度不足。

- .iwb-plp-nref.is-on 的文字色改为 color-mix(brand 45%, --iwb-text):
  亮色混深更沉、暗色混浅更亮,两端都过 4.5:1(估算 8.8:1 / 5.1:1)
  这是仓库既有写法(--iwb-focus-ring 也是 brand-text 混出来的),不新增token、不写死颜色
- 药丸底 tint 从 14% 提到 18%(暗色下淡底更可见)
- 勾选框描边改为 color-mix(--iwb-border2 70%, --iwb-text2):暗色描边提亮一档,未选中也能看清
2026-11-28 20:33:42 +08:00
qiqi 9b535e77ce fix(promptlib): 1.14.4/1.14.5 参考图勾选框对齐与暗色修正
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m1s
用户反馈:勾选后对勾没对齐;取消勾选是紫色;暗色下勾选框发黑。

- 未选中药丸改中性色:原来底/文字沿用了 promptlib 的紫色 accent(--iwb-plp-accent),
  现在用 --iwb-layer + --iwb-text2,只有 is-on 才是 brand 蓝
- 勾选框尺寸 14→15px、圆角改 --iwb-set-check-radius(4px) 呈方形(原来 6px 在 14px 上像圆点)
- 对勾改用 left/top 50% + translate(-50%,-58%) 居中,不再靠像素偏移
- 暗色:未选中填充用 --iwb-field(深一档的灰),避免在暗色药丸上变成黑块;边框仍用 --iwb-border2
- is-on 时张数 em 跟随文字色(opacity .8),不再固定灰
2026-11-28 20:27:12 +08:00
qiqi 016d837aae feat(promptlib): 1.14.3 参考图勾选框改成自绘蓝色实心勾(与样式节点一致)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m13s
- styles.css:.iwb-plp-nref 的 input[type=checkbox] 改 appearance:none 自绘:14px 圆角方块,
  选中时 brand 底 + 白色对勾(对勾用 --iwb-on-brand,不写死 #fff —— 插件主题契约禁止裸中性色)
  圆角用 --iwb-radius-chip(尺度闭集,否则 plugin-scale-contract 棘轮报新增 4px)
- .iwb-plp-nref.is-on:选中时药丸底色切成 brand 淡底 + brand 文字(同样式节点)
- main.js:st 里带上 refRow,同步时 toggle is-on
2026-11-28 20:16:59 +08:00
qiqi de92f0ec90 feat(promptlib): 1.14.2 提示词模板的「封面作参考图」开关移到头部(对齐样式节点)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m32s
用户要求:提示词变量节点里「图片参考选择」的位置,照样式节点改造。
原来 refRow 挂在节点最底部(变量列表之后),变量一多就要滚到底才点得到;样式节点是放在标题下方。

- plugins/promptlib/main.js:buildTplSkeleton 里把 refRow 挂进 titleBox(标题 + 变量数下方),
  底部不再追加
- styles.css:.iwb-plp-nref 从「底部分隔行」改成浅色药丸(inline-flex + accent 淡底 + 圆角),
  与样式节点的「示例图作参考 1 张」一致
- 版本 1.14.2,manifest 与 plugins/index.json 哈希同步
2026-11-28 20:03:46 +08:00
qiqi 4826649b72 feat(preview): 图片预览支持滚轮切换上一张 / 下一张
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
需求:鼠标滚轮(触控板双指)在预览里切图。

- src/ui-canvas-view.js:ImagePreview 根节点挂原生 wheel 监听(passive:false,否则 preventDefault 无效、页面会跟着滚)
  向下滚 = 下一张,向上滚 = 上一张;140ms 节流,触控板连续滚动不会一张张飞过去
  切图复用现有 go()/props.onNav,和 ←/→ 完全同一条路径
- 左右箭头按钮的 title 补上「或滚轮向上/向下」提示
2026-11-28 08:28:44 +08:00
qiqi 89bb19beab fix(gallery): 1.9.4 消除滚动加载时的闪动——卡片按宽高比占位 + 异步解码 + 加大预取
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 34s
闪动的来源:卡片初始只有「加载中…」那一行字的高度,缩略图一到就从一行字长成整图高,
整列跟着重排,滚动时看起来就是闪一下。

- itemNode:按 it.w/it.h 给卡片设 aspect-ratio,占位阶段就占好最终高度;有宽高时占位文案不写「加载中…」
- styles.css:占位层 absolute inset:0 铺满卡片(否则卡片高了、占位还是 84px 的小框)
- img 插入后调用 decode(),解码不占主线程
- 预取范围从 0.8/1.8 屏提到 1.2/2.4 屏,滚动时少触发几次窗口重排
2026-11-28 08:17:01 +08:00
qiqi b2bcc07cb5 fix(gallery): 1.9.3 列数跟着拖动实时变 + 列数切换不再有 1 秒停顿
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 40s
用户反馈 1.9.1 更好:1.9.2 的「列数滞回」导致拖动时列数不变、停手才变,而且那一次变化要停 1 秒。

- 去掉列数滞回:按宽度实时算列数;一检测到列数变化就立刻重排(rAF 合并一帧)
- 列数切换的重排改为「复用卡片节点」:把已有卡片 appendChild 到新列(DOM 移动),
  不再重建 40 张卡 + 重新解码缩略图 —— 那正是那 1 秒停顿的来源
- 修复用带来的两个问题:复用时把可能停在 display:none 的缩略图复位;img 不再先隐藏再显示
  (这两点导致 e2e 里图库缩略图「存在但 hidden」,已复跑通过)

保留:虚拟列表、选中就地更新、双击事件委托、列宽按真实容器算、容器/内边距缓存、缩略图缓存上限。
2026-11-28 08:10:30 +08:00
qiqi aefed6935b perf(gallery): 1.9.2 拖动路径再瘦身——列数滞回、滚动容器/内边距缓存、缩略图缓存上限
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 32s
- 列数滞回:切换阈值 ±12px 内保持原列数,避免拖动时 3/4 列来回跳(每次跳都要整轮重排)
- scrollerOf() 缓存滚动容器、usableW() 缓存内边距:原来每帧都 getComputedStyle,会强制样式重算
- 缩略图缓存加 FIFO 上限 400:200+ 张来回滚不会把 objectURL 一直攒在内存里
2026-11-28 07:53:57 +08:00
qiqi ff16f450c7 fix(gallery): 1.9.1 拖动只改列宽不重建 + 修「部分卡片永远停在加载中」
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
两个问题:
1) 拖动停靠栏仍然卡:虚拟列表虽然把渲染量降下来了,但每帧仍走 computeLayout + 重建约 40 张卡。
   现在列数不变时只改已有列的宽度(几条 style 写入),不重建任何节点;列数变化或停手 220ms 后才完整重排,
   松手(pointerup)立刻 flush 一次修正 y 偏移。
2) 有些图片不显示:虚拟列表滚动时卡片会被先移除再挂载,paint() 里 `if (!box.isConnected) return` 直接放弃,
   结果这些卡片永远停在「加载中…」(缩略图其实已经缓存好,只是没人挂上去)。已去掉该提前返回。

另加兜底:找不到真正的滚动容器、或内容不足一屏时,不做虚拟化(渲染全部),避免窗口算错出现空档。
2026-11-28 07:45:10 +08:00