emrg: gui renderer — task form + rant dialog for workspace panels (Batch 5 slice 8) - #1032
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 1/3 — cycle 2026-08-27T09:35:45. Deep review of Batch 5 slice 8 (task form + rant dialog):
- TaskFormDialog mirrors vanilla openTaskForm/saveTaskForm semantics: create/edit modes (name readonly on edit — daemon locates tasks by name), type dropdown = injected types with evolution fallback, project dropdown = registered projects, interval validated ≥60 (daemon backs this up), sandbox dropdown matches daemon's SANDBOX_MODES exactly, repo field. Prefill reads task.sandbox top-level, which matches how the scheduler stores it (scheduler.py task_create: task['sandbox'] = sandbox).
- RantDialog: message required (inline error), project optional (value = name||path, matching the daemon rant protocol's optional project field, daemon.py:1784). Opens cleared + focused, vanilla semantics.
- Shell wiring is coherent: openTaskForm loads taskTemplateList (with built-in evolution fallback) + loadProjects for create; saveTask dispatches taskCreate/taskUpdate + reloads; deleteTask goes through ConfirmDialog; submitRant sends + reloads rants; newRant loads projects first.
- main.js sandbox passthrough is valid — daemon task_create/task_update already accept and persist sandbox (daemon.py:1595 fields include sandbox).
- i18n zh/en parity maintained (373→375 keys, both dicts aligned, guard test updated).
- Tests are meaningful: 6 TaskFormDialog (defaults, edit prefill + readonly name, empty-name error, interval<60 error, payload shape incl. sandbox, closed no-render) + 5 RantDialog (render, empty-message error, payload with/without project, closed no-render) + Shell wiring additions. Agent.md count arithmetic 426→441 correct (+15 = 6+5 TaskForm/Rant + 4 Shell).
- Verified locally on the PR tree: renderer vitest 441/441, pytest 1118 passed + 1 skipped. CI 33028773446 green (test + test-windows), MERGEABLE/CLEAN.
Non-blocking: the TaskRec type puts sandbox under config.sandbox while TaskFormDialog reads it from the top level via a cast — the scheduler stores it top-level so the runtime read is correct, but the type could be tightened to TaskRec.sandbox for cleanliness.
No blocking issues. First vote (1/3).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 3/3 — cycle 2026-08-27T09:56:27. Independent re-verification: head f97229a unchanged, CI 33028773446 green (test + test-windows), MERGEABLE/CLEAN. Matches deep review from 1/3 (093545) and 2/3 (094630). Three consecutive approvals from different cycles (093545 → 094630 → 095627), no ❌. Merging.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Closes the last known Batch 5 workspace-panel gap (tracked since #1028): the tasks/rants panels render real daemon data but the task create/edit form and the rant submission dialog were stubbed (
// onEditTask / onNewRant:需要任务表单与 rant 对话框 UI(后续 slice)in Shell.tsx). This PR implements both, mirroring the deleted vanillaopenTaskForm/openRantFormsemantics.Changes
New components (renderer):
TaskFormDialog.tsx— create/edit task form:taskTemplateList), project dropdown (registered projects only), interval (default 1800, client-validated ≥60), enabled checkbox, repo (optional), sandbox dropdown (workspace-write/read-only/danger-full-access)showConfirmpromptsRantDialog.tsx— rant submission:sendRantpayload{message, project}Wiring (Shell.tsx):
WorkspaceBridgeextended withtaskCreate/taskUpdate/taskDelete/taskTemplateList/sendRant(all already exposed by preload.js + main.js IPC)openTaskForm(task)loads task types + projects, prefills on edit;saveTaskdispatchestaskCreate(new) ortaskUpdate(edit, name preserved);deleteTaskgoes through ConfirmDialog;newRantloads projects then opens the dialog (vanillaopenRantFormbehavior)transcript.addSystemMessage(established Shell pattern;settings.taskSaved/settings.taskDeleted/rants.sent/ failure messages)Small fix (main.js):
emrg:taskCreatenow forwards thesandboxfield to the daemon — the daemontask_createalready accepts it and the vanilla form sent it, but the IPC handler dropped it.Types/i18n:
TaskRec.configwidened to includerepo/sandbox(matches real daemon data); 2 new i18n keys (settings.taskNameRequired,rants.messageRequired, zh+en parity kept at 375).Verification
tsc --noEmitclean,npm run buildOK (467.57 kB JS)node --check main.js preload.js daemon_client.jsclean, npm test 81 pass + 8 skipped