fix(web): replay the last menu operator for Repeat Last
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

screen.repeat_last needs the WM runtime operator stack, which the embedded
host does not retain. Record the last menu operator and replay it in ?ui=web.
Verified add Circle 7→8; view-layer add/remove still pass.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-14 06:24:02 +08:00
parent 03c7e4ac74
commit d13cb3eeb1
3 changed files with 14 additions and 13 deletions

View File

@@ -387,15 +387,14 @@
- 视图层:场景 → 添加视图层 → `ViewLayer_001`;删除视图层 → 回到
`ViewLayer`,均返回“原生操作已返回”,通过。
- 重复上一步:`screen.repeat_last` 仍返回
`poll() failed, context is incorrect`。已尝试:
- 菜单调用传 `areaType=VIEW_3D`;
- `web_engine_python_bootstrap.py` 的 `temp_override` 增加
`screen=window.screen`(WASM `58325d97...`)。
仍失败;源码 `repeat_history_poll` 还要求 WM runtime operator 栈非空,
判断为嵌入宿主不保留该栈。下一步:在 Web 入口禁用并给出原因,或改用
bpy 侧可重放的操作记录实现。
- 新 WASM 已同步并重建 `web/dist`;证据
- 重复上一步:`screen.repeat_last` 因嵌入宿主不保留 WM runtime
operator 栈而 poll 失败;已补 `temp_override(screen=window.screen)` 与
`VIEW_3D` 上下文(WASM `58325d97...`),仍不足以恢复该栈。
- 回退实现:`queueLocalDesktopOperator` 记录最后一次菜单 operator 到
`lastMenuOperatorRef`,Web 入口的“重复上一步”重放该 operator 及其
properties/areaType。复测:添加 Circle(7)→ 重复上一步 → Circle.001
(8),状态“原生操作已返回:mesh.primitive_circle_add”。
- 视图层添加/删除同时通过;证据
`tools/web/complete/probe-repeat-viewlayer.mjs`。
## 下一动作