Skip to content

emrg: GUI task/template management in settings (rant 2026-08-12T18:23:15 P3) - #711

Merged
argszero merged 1 commit into
masterfrom
feature/gui-task-management
Aug 12, 2026
Merged

emrg: GUI task/template management in settings (rant 2026-08-12T18:23:15 P3)#711
argszero merged 1 commit into
masterfrom
feature/gui-task-management

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Final slice (P3) of rant 2026-08-12T18:23:15 (task generalization + GUI task management). P1 (#709) and P2 (#710, daemon task/template CRUD + hot reload) are already merged; this PR adds the GUI management UI on top of the P2 daemon commands.

Changes

  • Settings dialog — scheduled tasks section (#settings-dialog): task list (name / type / project / interval / enabled), plus Add / Trigger / Edit / Delete actions.
  • Task form (inline): name, type picker (builtin + custom types), project picker (registered projects only), interval (\u226560 enforced client-side too), enabled toggle, optional repo. Task name is immutable when editing (daemon locates by name).
  • Custom task types section: list of builtin (read-only, no action buttons) + custom types (edit / delete / add), prompt-template textarea form.
  • IPC + protocol wiring: emrg:taskCreate/Update/Delete and emrg:taskTemplateList/Create/Update/Delete in main.js + preload.js; new RESPONSE_TYPES entries (task_result / templates_list / template_result) in daemon_client.js — without these, sendCommandAndWait falls back to the command name as respType and would time out against the daemon's actual frame types.
  • i18n: 26 new keys (zh + en).

6 host-confirmed decision points enforced

  1. Builtin types read-only \u2705 (no edit/delete rendered; daemon also refuses)
  2. Deleting a referenced custom type refused \u2705 (daemon error surfaces with task count)
  3. Project selection limited to registered projects \u2705 (picker = listProjects)
  4. Hot reload \u2705 (P2 apply_tasks on every create/update/delete)
  5. Interval minimum \u2265 60s \u2705 (client-side validation + daemon validation)
  6. Builtin type templates read-only \u2705

Tests

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Independent re-verification on head a64b573 (11 files, 786+/2-, GUI task/template management P3 of rant 2026-08-12T18:23:15):

  1. Protocol wiring — RESPONSE_TYPES adds the 7 task/template commands (task_create/update/delete → task_result, task_template_list → templates_list, template create/update/delete → template_result), mirroring daemon.py handlers from #710. main.js IPC handlers validate name/type/project/prompt as non-empty strings before send, propagate daemon errors via throw, 8s CRUD / 5s list timeouts. preload exposes taskCreate/taskUpdate/taskDelete/taskTemplate{List,Create,Update,Delete}.
  2. Task management UI — list rows (name/type badge/project·interval·disabled hints) with trigger (reuses /trigger semantics), edit (form prefill, name disabled since daemon locates by name), delete (confirm dialog → taskDelete → renderTaskList). Form: type dropdown builtin+custom, project dropdown restricted to registered projects (decision ③), interval ≥60 client-side + daemon backstop (decision ⑤), enabled checkbox, optional repo.
  3. Template management — builtin types read-only (no action buttons rendered, decision ①⑥); custom templates create/update/delete with prompt preview (60-char truncation), delete-refused error surfaced via system message (decision ②), name immutable on edit.
  4. i18n — full zh/en key pairs (30+ keys) for all new strings; static data-i18n in index.html.
  5. Regression — ran GUI npm test: 229 passed (was 225, +4: RESPONSE_TYPES coverage + task list render/edit prefill + interval<60 rejection + template builtin-readonly CRUD); pytest 744 passed; doc-count guard green (Agent.md 225→229 breakdown updated correctly: 44 daemon_client + 107 renderer smoke). No issues found.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle. CI PASS (run 31589657813). Reviewed full diff: task/template CRUD IPC wired to daemon P2 commands, RESPONSE_TYPES entries added (task_result/templates_list/template_result — otherwise sendCommandAndWait falls back to the command name and would time out), settings UI enforces all 6 host decision points (builtin read-only, referenced-type delete refusal surfaced, registered-projects picker, hot reload via apply_tasks, interval >=60 client + daemon, builtin templates read-only), GUI 229 + pytest 744 green, doc counts synced.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR end-to-end and the implementation is solid. Verification results:

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle

3rd consecutive ✅ (re-verified head a64b573 unchanged from my R1145 review; daemon protocol + IPC wiring + renderer all previously audited). CI Test run 31589657813 SUCCESS. Merge condition met.

@argszero
argszero merged commit b8d4817 into master Aug 12, 2026
1 check passed

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle. Re-verified on head a64b573 (this cycle): full diff 11 files 786+/2- — task/template CRUD IPC (main.js+preload.js), RESPONSE_TYPES +7 (task_result/templates_list/template_result — prevents sendCommandAndWait fallback timeout), settings UI enforces all 6 host decisions (builtin read-only, referenced-type delete refusal, registered-projects picker, hot reload, interval >=60, builtin templates read-only). CI PASS 31589657813; local pytest 744 + GUI 229 green. No issues.

Sign up for free to 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