feat: edit road parameters by number as well as by drag

The map had one input device. A drag projects a pointer onto the manifest's
axis; there was no way to state a value, read one, or withdraw one.

Both channels now meet at the same three exits in App.tsx — draftValue()
previews, settleValue() commits one undoable command, abandonGesture() puts the
settled state back — so nothing about the constraint, the debounce or the
previewSeq arbitration is implemented twice. EditSession is untouched: focus and
blur land on the gesture boundary that pointerdown and pointerup already used,
which is why typing 1.53 is one undo step rather than four.

Three rules the two devices do not share:

- Live drag values bypass React and write the input's value directly, per
  direct-edit-client.md §7. A layout effect re-applies them after a mid-drag
  preview replaces the manifest, and drops the override once the manifest
  reports the value the drag asked for.
- Typed values out of range are refused, not clamped. A pointer cannot state an
  intent it never reached, so a drag clamps; typed text is an intent, and a
  clamped typo reads as a plausible value that can go unnoticed. The offered
  extremes round inward — a real max of 2.925 renders as 2.93 under
  nearest-rounding, which the range it came from would then reject.
- Reset disables the constraint rather than deleting it: validateEditDocument()
  rejects an operation naming a constraint that is not in the document. This is
  the one edit a drag cannot express, since a drag can set a value but never
  withdraw one.

Interval editing stays behind intervalEditingSupported, which is still false —
compileGeometry() does not read profile.interval, and a control that changes
nothing is worse than no control. The conversions are implemented and tested so
the row appears when the flag flips.

Probing a live manifest turned up a defect that is not from this change and is
not fixed here: an edge offset advertises ±2.925 while the solver rejects past
about ±1. Evidence is in the task's research/, and the requirement moved to
08-31-constraint-range-validation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
que01andClaude Opus 5 committed 2026-08-31 11:58:00 +08:00
1 parent 5e4e42c46f
commit 1c27501534
17 files changed
+1335 -15

No files matched your search

@@ -0,0 +1,58 @@
# manifest 范围与求解器可行域不一致
日期:2026-08-31
来源:`08-31-parameter-panel-binding` 实施期间对运行中工作台(`osm-KZZP9U`)的实测。
## 现象
手柄 `handle:road-edge-offset:segment:way/-3246/0:left`,manifest 声明
`value.min = -2.925`、`value.max = 2.925`(即 `±width * 0.45`,道路宽 6.5m)。
逐值探测 `POST /api/edit-preview`:
| offsetMeters | 阻塞诊断 |
| --- | --- |
| -2.90 | `direct-edit-outer-edges-cross` |
| -2.00 | `direct-edit-outer-edges-cross` |
| -1.00 | `direct-edit-outer-edges-cross` |
| **-0.50** | **(无)** |
| **0.00** | **(无)** |
| **0.50** | **(无)** |
| **1.00** | **(无)** |
| 2.00 | `direct-edit-outer-edges-cross` |
| 2.90 | `direct-edit-outer-edges-cross` |
| 500 | `direct-edit-outer-edges-cross` |
探针构造已排除误报:小幅值干净,说明请求本身合法。
## 结论
**manifest 宣告的范围比求解器实际接受的可行域宽约 3 倍,且双向都是。**
真实边界落在 `(-1.0, -0.5]` 与 `[1.0, 2.0)` 之间,未进一步二分。
失败原因未查明。`direct-edit-outer-edges-cross` 对应 design.md 的
「同一站点左右外缘不得交叉」不变量,但仅移动**单侧**外缘 1m
(6.5m 宽的路)为何会触发交叉,需要读 `compileGeometry()` 才能确定——
可能经由车道最小宽度 2.4m 派生,也可能诊断名不完全对应其实际判据。
## 与既有行为的关系
这不是本任务引入的。拖拽一直夹到 `±2.925`,所以用户一直能拖进被拒区间——
拖过约 1m 后几何冻结、诊断出现,而手柄继续走到 2.925。
按 design.md「无效草稿不替换最后一个有效预览」,这是既定行为。
参数面板没有改变它,但**把它变可见了**:范围以文字打印,且极值可一键填入。
点击极值会得到一个必被服务端拒绝的值。
## 处理
未在本任务修改。理由:
- 客户端范围校验必须用 manifest 的 `min`/`max`,用别的就是发明第二个真相来源
(`direct-edit-client.md` §2)。
- 收窄范围需要求解器解析地算出外缘交叉的可行区间,属求解器工作,
本任务明确排除。
- 点击极值的结果是一个诚实的服务端拒绝:诊断可见、最后一个有效预览保留、可撤销。
不是静默破坏。
已并入 `08-31-constraint-range-validation` 的需求。