feat(v2): compact monitor status row, small buttons, screenshot gallery

Right panel now shows connection+detection status on one line, small
start/stop buttons on one line, event text with the red-note inline, and a
3x3 reverse-chronological gallery of recent confirmed screenshots filling
the rest. Double-clicking a thumbnail opens a full-image overlay. Gallery
items are collected off the UI thread from confirmed updates (deduped by
event id) and each ImageOp is built once and cached. Cross-compiles for
Windows; no new deps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ila
2026-07-23 20:58:45 +08:00
co-authored by Claude Opus 4.8
parent 8440bdefdf
commit ea24fc4c4b
2 changed files with 229 additions and 64 deletions
+9
View File
@@ -595,3 +595,12 @@
- 阻塞:窗口目视需 Windows。
- 决策:画廊数据源用 `Present` 里的确认帧(`update.Image` 是 render 输出的截图内容)+ `update.Events` 记录,按 event_id 去重、UI 线程外收集;`paint.ImageOp` 每项只建一次并缓存,避免逐帧重解;双击用点击时间窗判定,全图弹窗复用遮罩 Stack。
- 下一步:改 window.go 布局与画廊,交叉编译通过后用户 Windows 目视。
## 【2026-07-23】T-307 V2 监控界面优化(代码完成 + 交叉编译验证)
- 状态:DOING(代码完成 + Windows 交叉编译通过;窗口目视需 Windows)
- 变更:重写 `v2/internal/ui/window.go` 布局——右栏:①运行状态+检测状态压一行(Critical 红)②开始/停止用 `smallButton`(小内边距/字号)同一行 ③"事件"文本与"红色=确认摔倒"说明同一行 ④剩余区域 `layoutGallery` 3×3 倒序展示最近 9 张确认截图 ⑤双击缩略图(350ms 内两次点击)经 `layoutViewer` 全屏遮罩弹全图、"关闭"按钮退出。画廊数据源:`Present` 收到含确认事件的 `update`(`update.Image` 即 render 截图内容)时按 event_id 去重入队(UI 线程外),`layout` 里每项建一次 `paint.ImageOp` 缓存、超 9 张淘汰最老。确认弹窗与图片弹窗共用遮罩 Stack。
- 验证:`GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -mod=vendor ./internal/ui/... ./cmd/ui-spike/...` 退出码 0。未引入新依赖(仅 stdlib `time`),vendor 不变。本环境无法运行 Gio,布局/双击目视需 Windows。
- 阻塞:窗口目视需 Windows。
- 决策:缩略图与全图复用同一 `ImageOp`(Gio 只上传一次纹理,缩略图 cell 用 `Fit:Contain` 缩放);`gallery` 存指针避免拷贝 `widget.Clickable`;`viewing` 存 `*galleryItem` 指针,列表重排也稳定。
- 下一步:用户 Windows `go run ./cmd/silver-pose` 目视新布局与画廊、双击看原图;据反馈微调间距/比例后置 DONE。