feat(junction): add stage2 object selection scope controls

This commit is contained in:
que01 committed 2026-09-07 15:23:03 +08:00
1 parent b89c5fd174
commit de6ef8e64b
8 files changed
+131 -5

No files matched your search

@@ -0,0 +1,2 @@
{"file":".trellis/spec/frontend/direct-edit-client.md","reason":"Verify shared edit protocol and reset semantics."}
{"file":".trellis/spec/frontend/quality-guidelines.md","reason":"Run client checks and preserve component boundaries."}
@@ -0,0 +1,7 @@
# 技术设计
`JunctionWorkspace` 持有路口级选择键,`App` 仍是组合根,现有 `EditSession` 继续拥有约束、预览和撤销历史。新增的选择适配器只把设施/诊断/handle 映射到结构对象键,不复制几何或保存协议。
作用域覆盖使用现有 handle 的 `constraintId` 和 `affects` 集合:全局操作选择同类 handle 组,局部操作只发送当前对象 handle;恢复全局调用现有 `onReset`,由 EditSession 记录禁用约束。UI 显示继承来源,不另建一套 draft。
所有新状态都必须兼容旧 state 缺失结构字段;旧路口继续使用现有参数面板。
@@ -0,0 +1,4 @@
{"file":".trellis/spec/frontend/direct-edit-client.md","reason":"Reuse EditSession, handle and preview ownership."}
{"file":".trellis/spec/frontend/state-management.md","reason":"Follow state ownership and selection update patterns."}
{"file":".trellis/spec/frontend/component-guidelines.md","reason":"Keep JunctionWorkspace composition and controls consistent."}
{"file":".trellis/spec/guides/cross-layer-thinking-guide.md","reason":"Avoid duplicating compiler-owned object identity."}
@@ -0,0 +1,6 @@
# 实施清单
1. 建立对象选择键与结构对象到设施/handle/诊断的归一化工具。
2. 将 `JunctionWorkspace` 的设施选择、诊断定位和参数高亮统一到 `selectedObjectKey`。
3. 为当前对象参数增加全局继承、局部调整和恢复全局控件,复用现有 EditSession 回调。
4. 增加选择与覆盖交互单测,运行完整前后端质量门禁。
@@ -0,0 +1,44 @@
# JunctionTools Stage 2 选择与作用域覆盖
## Goal
TBD.
## Requirements
- TBD
## Acceptance Criteria
- [ ] TBD
## Notes
- Keep `prd.md` focused on requirements, constraints, and acceptance criteria.
- Lightweight tasks can remain PRD-only.
- For complex tasks, add `design.md` for technical design and `implement.md` for execution planning before `task.py start`.
# JunctionTools Stage 2:对象选择与作用域覆盖
## 目标
让路口对象在列表、地图设施、手柄和诊断之间共享唯一选择键,并让稳定的 direct-edit 参数明确显示全局继承或局部覆盖状态。
## 范围
- 增加 `selectedObjectKey` 状态,列表/设施/诊断定位统一写入它。
- 对道路臂、角部、横道和停止线显示当前对象的参数归属。
- 提供“使用全局值 / 单独调整 / 恢复全局值”交互;局部调整只作用于当前对象。
- 保持现有预览、撤销/重做、重置对象、放弃草稿和版本冲突协议。
## 非范围
- 不实现新的几何算法或高级设施。
- 不根据客户端节点数量推断路口形态。
- 不把 warning/blocking 标准诊断变成新的保存门禁。
## 验收标准
1. 列表、地图设施和诊断定位使用同一个 `selectedObjectKey`,切换对象不会残留旧表单。
2. 未单独调整的对象显示全局继承;局部修改只影响当前对象,并能恢复全局。
3. 当前对象重置与放弃全部草稿行为保持现有语义,预览请求仍经过同一 EditSession。
4. 单测覆盖选择归一化、作用域切换和恢复全局;客户端类型检查、单测、构建、格式检查及后端回归通过。
@@ -0,0 +1,26 @@
{
"id": "junctiontools-stage2-selection-overrides",
"name": "junctiontools-stage2-selection-overrides",
"title": "JunctionTools Stage 2 选择与作用域覆盖",
"description": "",
"status": "in_progress",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "dingkang",
"assignee": "dingkang",
"createdAt": "2026-09-07",
"completedAt": null,
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [],
"notes": "",
"meta": {}
}