Skip to content

feat(summary): custom summary template editor with JSON authoring - #4

Merged
karan68 merged 1 commit into
devtestfrom
feat/summary-template-editor
Jul 17, 2026
Merged

feat(summary): custom summary template editor with JSON authoring#4
karan68 merged 1 commit into
devtestfrom
feat/summary-template-editor

Conversation

@karan68

@karan68 karan68 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a custom summary template editor so users can control how meeting records are
structured, including JSON-level authoring. Templates were already JSON-backed and
override-able on disk; this exposes create/edit/duplicate/delete in the UI and adds raw
JSON editing, import, and export. Implements the actionable part of #257 (editable
summarization) without a raw system-prompt override.

The fixed prompt preamble (multi-language contract + prompt-injection guard) and
api_process_transcript's signature are unchanged — only the template's section
instructions (the safe, functional part of the prompt) are editable.

What changed

Backend (frontend/src-tauri/src/summary/)

  • template_commands.rs: TemplateInfo now carries source/editable/deletable; new
    api_get_template_content, api_save_template, api_delete_template (registered in lib.rs).
  • templates/loader.rs: template_source, is_valid_template_id, and
    save_custom_template/delete_custom_template over the existing JSON-file store, with a
    crash-safe temp-file + backup swap on save.
  • templates/types.rs: validation bounds — trim/whitespace rejection, unique section
    titles, ≤30 sections, and character limits (name 120, description 500, title 120,
    instruction 2000, item_format 500).

Frontend

  • New components/SummaryTemplateManager.tsx card in Settings → Summary: list with
    Built-in/Custom badges; create / edit / duplicate / delete (delete via ConfirmationModal);
    Form / JSON toggle with raw JSON editing + Validate; Import JSON; Copy JSON.
    Section reorder (up/down), discard-changes confirmation, collision-free ids.
  • New lib/summary-template.ts helpers (slugifyTemplateId, createUniqueTemplateId,
    moveArrayItem) + tests/lib/summary-template.test.mjs.
  • Wired into components/SummaryModelSettings.tsx.

Docs

  • README.md: "Custom summary templates" section with the schema, a full example, a
    minimal example, a field reference (with limits), and on-disk locations.

Editing model

  • Editing a built-in saves a same-id custom override; deleting the override restores the
    built-in. Only custom templates are deletable.
  • Freedom is within the fixed schema (formatparagraph | list | string); there is
    intentionally no arbitrary system-prompt override.

Testing

  • Backend: 17/17 summary::templates tests pass (incl. new validation + atomic-save tests).
  • Frontend: tsc --noEmit clean; 66/66 Bun tests (incl. 3 new helper tests).
  • Manual (recommended before release): create/edit/duplicate/delete; Form↔JSON round-trip;
    Import/Copy JSON; edit a built-in → becomes Custom → delete reverts; invalid JSON/format
    is rejected with a clear message; template appears in the meeting summary picker.

Notes

  • No new dependencies. Clipboard uses navigator.clipboard (already used elsewhere in the app).
  • FUTURE_ROADMAPS.md (living project roadmap) is included in this push.

Add a template editor in Settings -> Summary to create, edit, duplicate, and delete summary templates. Editing a built-in saves a same-id custom override; deleting it restores the built-in. Includes a Form/JSON toggle for raw JSON authoring (validated), Import JSON, and Copy JSON export.

Backend: expose template source/editable/deletable metadata and get-content/save/delete commands over the existing JSON-file template store; add validation bounds (trim, unique titles, section and character limits) and a crash-safe temp-file+backup save. Frontend: SummaryTemplateManager plus summary-template helpers (collision-free ids, section reorder). The fixed multi-language/prompt-injection preamble and api_process_transcript signature are unchanged.

Docs: README custom summary template section with schema and JSON examples.

Verified: 17 backend template tests pass; tsc --noEmit clean; 66/66 Bun tests.
@karan68
karan68 merged commit 0d956b5 into devtest Jul 17, 2026
6 of 7 checks passed
@karan68
karan68 deleted the feat/summary-template-editor branch July 17, 2026 15:30
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.

1 participant