Skip to content

Document templates: 'New from template…' for docx (board minutes, proposal, report) #29

Description

@criptogus

Summary

Extend the template system from decks only to documents: ship a templates/ set for recurring document types (board meeting minutes, proposal, report, meeting notes) and add a "New from template…" entry in the Home screen and Quick Switcher that creates a docx from a chosen template.

Motivation

  • HermesOffice already has a polished deck-template pipeline (templates/deck-*.pptx, tools/gen-templates.py). Documents have no equivalent — every docx starts blank.
  • Recurring docs (the user produces board minutes, proposals, reports weekly) are exactly where templates remove friction and enforce house style.
  • Template files are plain OOXML in the repo → community can contribute new ones with zero code knowledge.

Proposed UX

  • Home: "New" button gets a second action New document from template… → modal with template cards (name, preview thumbnail, tags).
  • Quick Switcher (once it exists) also lists templates when query matches template:.
  • Template picker shows: built-in set (from the repo templates/) — the app loads them read-only; "Use" duplicates the file to a chosen location (or the active project) and opens it in a new tab.
  • v1 scope: docx templates only (pptx already covered by the deck flow; xlsx later).

Implementation notes

  • Where templates live: extend the existing templates/ directory in the repo (currently deck-base.pptx, deck-nocturne.pptx, deck-blue-white.pptx, deck-mocha.pptx). Add doc-board-minutes.docx, doc-proposal.docx, doc-report.docx, doc-meeting-notes.docx — built with python-pptx-equivalent tooling (python-docx) via an extension of tools/gen-templates.py so they're regenerable, not hand-edited binaries. Keep the same "regenerate from source" convention.
  • App loading: the installed app must bundle the templates (check how the deck templates are shipped today — via the MCP connector /tmp/genoffice/templates/ or embedded in the shell); mirror that mechanism so templates/ in the repo is the single source of truth.
  • Creation flow: "Use template" = copy file to target path + HOME_CHANNELS.openPath on it (existing open flow). Optionally fill placeholders ({{TITLE}}, {{DATE}}) — v1: leave placeholders in the text, show a hint bar "Replace placeholders" (or let the AI panel do it on request — natural first AI integration: "fill this template").
  • Home UI: apps/shell/src/renderer/src/Home.tsx new-doc menu; template metadata as a small templates/manifest.json (name, type, tags, thumbnail path) so the picker is data-driven.

Acceptance criteria

  • ≥4 document templates ship, regenerable via tools/gen-templates.py.
  • "New from template…" creates a docx, opens it in a new tab, and the original template file is untouched.
  • Template picker is data-driven from manifest.json (adding a template = adding files + manifest entry).
  • Templates work after install (bundled), not just in a dev clone.
  • Deck flow (existing) unaffected.

Out of scope

  • Placeholder auto-fill engine (v1 leaves {{…}} tokens; AI fill is a follow-up).
  • xlsx/slides template picker (slides keep the existing patch-from-template flow).
  • User-created template library (community contributions land in the repo templates/ for now).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions