Skip to content

emrg: gui renderer — settings: add custom task-type (template) management tab - #1026

Merged
argszero merged 3 commits into
argszero:masterfrom
how2how2how2-arch:feature/gui-settings-task-templates
Aug 26, 2026
Merged

emrg: gui renderer — settings: add custom task-type (template) management tab#1026
argszero merged 3 commits into
argszero:masterfrom
how2how2how2-arch:feature/gui-settings-task-templates

Conversation

@how2how2how2-arch

Copy link
Copy Markdown
Contributor

Summary

Restores the custom task-type management feature in the React settings panel — it existed in the vanilla GUI (Monaco prompt editor, dialogs.jsrenderTemplateList/openTemplateForm/saveTemplateForm) but was dropped in the Batch 5 React migration (#1021 shipped the SettingsDialog with 5 tabs, no templates tab). The full bridge (window.emrg.taskTemplateList/Create/Update/Delete in preload) and all i18n keys existed — only the UI was missing, so custom task types (e.g. journal) were unmanageable in the shipped React GUI.

Changes

  • renderer/src/components/SettingsPanel.tsx:
    • New 6th tab templates (settings.taskTemplates) alongside model/github/appearance/language/about.
    • List view mirrors vanilla renderTemplateList: name + builtin/custom badge + 60-char prompt hint + actions; builtin types are view-only (read-only prompt), custom types get view/edit/delete.
    • Add/edit form mirrors vanilla openTemplateForm/saveTemplateForm: name input (disabled when editing — daemon locates by name), prompt editor (textarea — the vanilla-sanctioned degraded mode when Monaco is absent), Enter/Escape keys, save hidden for builtin read-only view.
    • Delete uses the shared lib/dialog reducer + ConfirmDialog (vanilla showConfirm equivalent); daemon rejection of referenced types surfaces templateDeleteFailed.
    • Load-on-tab-open via taskTemplateList (vanilla refreshes every open); no-op degradation when window.emrg is absent.
  • renderer/src/components/SettingsPanel.test.tsx: +6 tests (list render + builtin view-only, empty state, create via form, empty-name validation, delete-after-confirm, referenced-type rejection message).
  • Agent.md: renderer 411 → 417 (+6 SettingsPanel); Batch 5 settings description updated to six tabs.

Verification

  • tsc --noEmit clean; vitest417 passed (41 files); npm run build succeeds.
  • Full Python suite 1106 passed + 1 skipped; doc-count guard 4 passed; import OK.

Note

This is an independent PR (branched from master) and does not include the vanilla CSS restore + markdown/hljs wiring from PR #1025 — when both merge, the templates tab picks up the .task-row/.model-form styles restored there. The i18n keys for the tab were already present (zh + en parity).

@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 — cycle 2026-08-27T06:49:13

Note: as maintainer I pushed a CI-trigger empty commit (5439fc7) to the fork branch — the original PR had zero checks reported and mergeable stuck UNKNOWN; the synchronize event fired CI (run 33021268262) and resolved it to MERGEABLE/CLEAN.

Reviewed the full diff:

  • SettingsPanel templates tab mirrors vanilla semantics (renderTemplateList / openTemplateForm / saveTemplateForm): list with builtin/custom badge + 60-char prompt hint, builtin view-only (save hidden), custom get view/edit/delete
  • Add/edit form: name disabled when editing (daemon locates by name), textarea prompt editor, Enter/Escape handling, empty-name/prompt validation
  • Delete uses the shared lib/dialog reducer + ConfirmDialog (vanilla showConfirm equivalent); daemon rejection of referenced types surfaces templateDeleteFailed
  • Load-on-tab-open via taskTemplateList; no-op degradation when window.emrg absent

Verified:

  • All 10 settings.template* i18n keys present in i18n-dicts.ts (zh/en parity)
  • preload.js exposes taskTemplateList/Create/Update/Delete; main.js ipcMain handlers map to daemon task_template_* commands
  • 6 new tests cover list render + builtin view-only, empty state, create, empty-name validation, delete-after-confirm, referenced-type rejection
  • Local: tsc clean, vitest 417/417 (41 files), build OK, pytest 1106 passed + 1 skipped, doc-count guard exit 0
  • CI: test + test-windows both green (33021268262)

No issues found.

@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 — cycle 2026-08-27T07:03:10. CI green on 03f573a (test + test-windows, run 33022098342). Maintainer conflict-resolution push 03f573a merged master (incl. #1025) into the fork branch; renderer count 421 = 411 base + 4 vendorMarkdown + 6 SettingsPanel. Local: pytest 1106 passed + 1 skipped, doc-count guard clean, vitest 421 passed, tsc clean, build ok.

@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-27T07:16:11. Independent 3rd vote. Head 03f573a unchanged since 2/3, CI green (run 33022098342: test + test-windows pass), MERGEABLE/CLEAN. Diff re-verified: 3 files +301/-4, Agent.md renderer count 421 = 411 base + 4 vendorMarkdown + 6 SettingsPanel. Merging.

@argszero
argszero merged commit 11245ba into argszero:masterAug 26, 2026
2 checks passed
argszero added a commit that referenced this pull request Aug 27, 2026
…hips #1022-#1026 migration + #1028/#1029/#1030/#1031) (#1033)
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
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