From 15d41be44416ed412a6183a61b6d7b21df4b9ae3 Mon Sep 17 00:00:00 2001 From: que01 Date: Mon, 31 Aug 2026 17:12:57 +0800 Subject: [PATCH] chore(task): record progress and the blocker on corner grips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps 1, 2 and 4 are done and step 3 is parked with a reason: the client never reads affects and no highlighting exists, so fixing it alone changes nothing a user can see. It belongs with the highlight, as one piece of work. Step 5 has a design question that should be settled before code. The size value is a pair while the drag path is scalar end to end, so a corner grip moving one component has to preserve the other or every drag resets the half it did not touch. Three options noted, with the reason the tempting one — letting element controls build their own value — is the wrong shape. Co-Authored-By: Claude Opus 5 (1M context) --- .../implement.md | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.trellis/tasks/08-28-crosswalk-element-editor/implement.md b/.trellis/tasks/08-28-crosswalk-element-editor/implement.md index c23eed8..b7c1072 100644 --- a/.trellis/tasks/08-28-crosswalk-element-editor/implement.md +++ b/.trellis/tasks/08-28-crosswalk-element-editor/implement.md @@ -97,11 +97,11 @@ npm run build | 步骤 | 状态 | | --- | --- | | 0 建立事实与测试夹具 | ✅ | -| 1 元素选择 | ✅ `edit/element.ts`,浏览器已确认 | +| 1 元素选择 | ✅ `edit/element.ts`,浏览器已确认;已推广到停止线 | | 2 选中框与移动 | ✅ 虚线框可直接拖拽 | -| 3 修正 `affects` | ⬜ 未开始 | -| 4 编译器尺寸参数化 | ⬜ 未开始 | -| 5 四角尺寸抓手 | ⬜ 未开始 | +| 3 修正 `affects` | ⏸ 暂缓——客户端从不读 `affects`,高亮未实现,单独修不可见。应与高亮作为一件事做 | +| 4 编译器尺寸参数化 | ✅ `junction-crosswalk-size`,门禁已过,基线已更新 | +| 5 四角尺寸抓手 | ⬜ 未开始,见下方设计难点 | | 6 复盘 | 部分:推广分析见 `research/generalising-to-other-markings.md` | 第 1–2 步之外另修了两处既有缺陷:`MapCanvas` 的陈旧闭包与空白点击不上报, @@ -110,3 +110,25 @@ npm run build 手测确认:选中、虚线框、拖拽均可用。**尚未手测**:框跟随修复后的表现、 上界修复后的拖拽手感——两者都需重启工作台进程才能生效。 + +## 第 5 步的设计难点(未解决) + +`junction-crosswalk-size` 的值是**一对数** `{ depthMeters, stripeCount }`, +而拖拽链路是标量的:`projectHandleValue` 产出一个数,`constraintValueFor` +把它包成一个 value。四角抓手需要两个自由度: + +- 一轴改进深(连续,米) +- 一轴改跨度(量化,写回 `stripeCount`) + +拖其中一个必须**保留另一个的当前值**,否则每次拖拽都会把未触碰的那半重置为默认。 +可行方向(未定): + +1. 发两个标量手柄,`draftFor` 在构造 value 时与已有约束合并 +2. 扩展 `EditHandle` 表达多分量,改动面更大 +3. 元素控件不走 `draftFor`,自己构造 value——**违反「两条通道汇合于同一出口」**,不推荐 + +方向 1 最小,但需要 `draftFor` 能读到该约束的当前值;目前它只从 handle 拿标量。 +动手前应先定这个,否则会长出第二条 draft 路径。 + +另:`junction-crosswalk-size` 已加入 `JUNCTION_KINDS` 但**不在** `CONTROL_KINDS`, +所以参数面板不渲染它——它的值是一对数,而面板渲染标量。接入抓手时一并处理。