emrg: gui renderer — settings: add custom task-type (template) management tab - #1026
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ 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.
… vendor wiring, renderer count 421)
argszero
left a comment
There was a problem hiding this comment.
✅ 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.
argszero
left a comment
There was a problem hiding this comment.
✅ 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.
Uh oh!
There was an error while loading. Please reload this page.
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/Deletein 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:templates(settings.taskTemplates) alongside model/github/appearance/language/about.renderTemplateList: name + builtin/custom badge + 60-char prompt hint + actions; builtin types are view-only (read-only prompt), custom types get view/edit/delete.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.lib/dialogreducer +ConfirmDialog(vanillashowConfirmequivalent); daemon rejection of referenced types surfacestemplateDeleteFailed.taskTemplateList(vanilla refreshes every open); no-op degradation whenwindow.emrgis 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 --noEmitclean;vitest417 passed (41 files);npm run buildsucceeds.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-formstyles restored there. The i18n keys for the tab were already present (zh + en parity).