Skip to content

fix(editor): 修复动态配方重新选区后无法编辑 - #302

Open
MOVIBALE wants to merge 1 commit into
mainfrom
MOVIBALE/fix/dynamic-recipe-reselection
Open

MOVIBALE wants to merge 1 commit into
mainfrom
MOVIBALE/fix/dynamic-recipe-reselection

Conversation

@MOVIBALE

Copy link
Copy Markdown
Collaborator

Summary

修复动态耗材模式下,手动改过配方的区域重新选中后无法继续编辑的问题(LUM-202611-b6d655ed)。选区编号会随操作变化,原实现按旧编号查找手动配方,导致 /region-recipe 返回 409。

现在用与配方采样相同的像素定位已保存的覆盖掩码,按最近一次编辑优先读取实际配方。保留真实耗材层与补齐底层的区别;重叠编辑、重新选区及撤销/重做均能读回正确层数。复用现有掩码解析逻辑,无需重新计算预览。

Validation

  • 工单原始会话(1600×2135、17 种耗材):重新选中 17,343 像素的手动区域,修复前返回 409,修复后准确返回原 6 层配方。
  • 同一原始会话通过真实 API 连续修改、撤销、重做、清除并重新点选、再次修改;均成功。核对 3,398,657 个未选像素的完整打印配方,全部保持不变。配方预测使用工单原耗材数据;仅关闭异步 GLB 副产物。
  • python -m pytest tests/test_dynamic_material_editing_unit.py tests/test_dynamic_material_lifecycle_integration_unit.py tests/test_dynamic_svg_edit_lifecycle_integration_unit.py tests/test_dynamic_material_api_contract_unit.py tests/test_converter_replace_integration_unit.py tests/test_selection_recipe_regression.py tests/test_editor_selection_unit.py tests/test_api_errors_unit.py tests/test_structured_logging_unit.py tests/test_logger_unit.py -q:151 passed。
  • 新增回归用例先复现 4 个失败,再验证修复;覆盖压缩/旧版掩码、重叠编辑、相同打印栈但不同实际层数、多选区及两种层序。
  • python scripts/run_smoke_tests.py:通过;前端 lint 无错误。
  • python scripts/log_quality_check.py --mode fast --workflow preview,generate,replace_bw:通过。

AI assistance

Models and tools: GPT-6 family(具体变体不可用),通过 Codex。

What each model helped with: 分析原始工单和保存的会话,复现选区编号与手动配方关联丢失,实现修复、回归测试和 API 重放脚本,撰写本 PR。

How the output was checked: Codex 执行了上述原素材 API 重放、像素配方比对、测试和日志检查;详见 Validation。未将用户原图、耗材或日志提交到仓库。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant