mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
Plan Q1 / spec §21.5.
apps/web/src/components/GenUISurfaceRenderer.tsx now ships first-
class branches for the auto-derived diff-review choice surface and
generic single-enum-property choice surfaces.
Diff-review (DiffReviewChoiceSurface):
- Three top-level buttons: 'Accept all' / 'Reject all' / 'Partial…'.
- Optional 'Skip' when the host supplies onSkip.
- Optional notes textarea — forwarded as decision.reason when non-empty.
- On 'Accept all': submits { decision: 'accept', accepted_files,
rejected_files: [] } using the touched file list from
pending.context.touchedFiles. Daemon side default-fills when the
list is empty.
- On 'Reject all': symmetric.
- On 'Partial…': reveals a per-file accept/reject toggle for each
touched file. Submit refuses locally when ANY file is left
undecided (mirrors the daemon's 'partial must cover every
touched file' contract from §3.O5 so the user doesn't ping the
server with an obviously-invalid payload).
- Disabled when context.touchedFiles is empty (the daemon's
default-fill path doesn't help with a partial decision).
Generic choice (GenericChoiceSurface):
- Detects schemas of shape `{ properties: { <key>: { enum: [...] } } }`
and renders one button per enum value. Property literally named
'decision' wins over other enum properties when several are
declared (so plugin-author-customised diff-review schemas keep
rendering as accept/reject/partial buttons even if they add
extra fields).
PendingSurface gains an optional `context: { touchedFiles?: [] }`
field. Future runtime-context entries plug in here without bloating
the GenUISurfaceSpec contract.
Web tests: 586 → 593 (+7 cases on
GenUISurfaceRenderer.diff-review: accept-all default-fill, reject-
all default-fill, partial union, partial blocks on undecided file,
partial disabled when context absent, optional reason forwarding,
generic single-enum choice button group).
Co-authored-by: Tom Huang <1043269994@qq.com>
|
||
|---|---|---|
| .. | ||
| artifacts | ||
| components | ||
| edit-mode | ||
| i18n | ||
| providers | ||
| runtime | ||
| state | ||
| utils | ||
| App.test.ts | ||
| comments.test.ts | ||
| quickSwitcherRecents.test.ts | ||
| router-marketplace.test.ts | ||
| sidecar-proxy.test.ts | ||