Skip to content

emrg: gui renderer — task form + rant dialog for workspace panels (Batch 5 slice 8) - #1032

Merged
argszero merged 1 commit into
argszero:masterfrom
how2how2how2-arch:feature/gui-task-form-rant-dialog
Aug 27, 2026
Merged

emrg: gui renderer — task form + rant dialog for workspace panels (Batch 5 slice 8)#1032
argszero merged 1 commit into
argszero:masterfrom
how2how2how2-arch:feature/gui-task-form-rant-dialog

Conversation

@how2how2how2-arch

Copy link
Copy Markdown
Contributor

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 vanilla openTaskForm/openRantForm semantics.

Changes

New components (renderer):

  • TaskFormDialog.tsx — create/edit task form:
    • name (read-only when editing — daemon locates tasks by name), type dropdown (builtin + custom from 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)
    • inline validation errors (name required, interval ≥60) — replaces vanilla's showConfirm prompts
  • RantDialog.tsx — rant submission:
    • message (required) + optional project dropdown (registered projects), inline validation, sendRant payload {message, project}

Wiring (Shell.tsx):

  • WorkspaceBridge extended with taskCreate / taskUpdate / taskDelete / taskTemplateList / sendRant (all already exposed by preload.js + main.js IPC)
  • openTaskForm(task) loads task types + projects, prefills on edit; saveTask dispatches taskCreate (new) or taskUpdate (edit, name preserved); deleteTask goes through ConfirmDialog; newRant loads projects then opens the dialog (vanilla openRantForm behavior)
  • Feedback via transcript.addSystemMessage (established Shell pattern; settings.taskSaved / settings.taskDeleted / rants.sent / failure messages)

Small fix (main.js): emrg:taskCreate now forwards the sandbox field to the daemon — the daemon task_create already accepts it and the vanilla form sent it, but the IPC handler dropped it.

Types/i18n: TaskRec.config widened to include repo/sandbox (matches real daemon data); 2 new i18n keys (settings.taskNameRequired, rants.messageRequired, zh+en parity kept at 375).

Verification

  • New tests: TaskFormDialog 6 (defaults/prefill/edit-readonly/validation/payload shape), RantDialog 5 (render/validation/project-select/empty-project), Shell +4 (add-task flow → taskCreate, edit flow → taskUpdate with name preserved, delete confirm → taskDelete, rant flow → sendRant) — all pass
  • Full renderer suite: 441/441 (426 → 441), tsc --noEmit clean, npm run build OK (467.57 kB JS)
  • GUI: node --check main.js preload.js daemon_client.js clean, npm test 81 pass + 8 skipped
  • Python: 1118 passed + 1 skipped, import + CLI OK, doc-count guard 4 passed (Agent.md 426 → 441 synced)

@argszeroargszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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).

@argszeroargszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM 2/3 — cycle 2026-08-27T09:46:30. Independent re-verification: head f97229a unchanged, CI 33028773446 green (test + test-windows), MERGEABLE/CLEAN. No new feedback since 1/3 (093545).

@argszeroargszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@argszero
argszero merged commit 067c994 into argszero:masterAug 27, 2026
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@how2how2how2-arch@argszero