Submission generator preview still shows raw HL Patents Style .dotm — diagnose + author at least one universal placeholder template #90

Open
opened 2026-05-25 12:38:24 +00:00 by mAi · 0 comments
Collaborator

m's report (2026-05-25 14:37)

The submission generation still always shows the preview that was our dotm template file for hl patent style. We should just try it with a NEW template that at least includes some of the variables when generating

Context

  • t-paliad-253 / m/paliad#84 (commit 5df87f4) fixed the /generate one-click button — handleGenerateProjectSubmission now runs SubmissionDraftService.RenderProjectSubmission (vars.Build + renderer.Render) and respects the per-firm submissionTemplateRegistry.
  • ritchie's t-paliad-241 + brunel's #84 extension wired ONE per-firm template (de.inf.lg.erwidg.docx) with the full 48-variable placeholder set.
  • For ALL OTHER submission_codes, the template fallback chain ends at the universal HL Patents Style.dotm (letterhead only, NO placeholders). So picking any non-de.inf.lg.erwidg code still shows a bare letterhead in the preview.

m's report could mean any of three things — diagnose in order:

Candidate A — deploy lag

brunel's fix landed at 12:55 local; subsequent merges (#85 #82 #83 #87 #88) may have queued Dokploy redeploys. paliad.de's container might not yet be on the fix's binary. Check:

curl -s -I https://paliad.de/healthz
curl -s https://paliad.de/api/version 2>/dev/null  # if exposed
# or check the Schriftsätze Bearbeiten for de.inf.lg.erwidg — if variables substitute there
# but the preview/generate-button shows empty, deploy lag is the culprit

If deploy lag, wait + re-test; no code action.

Candidate B — preview code path differs from /generate

The editor's preview pane (HTML rendered in the sidebar/main pane of the Schriftsätze draft editor) might use a different endpoint or render path than /generate. Search:

grep -rn 'preview\|Preview\|render_html\|html_render' internal/handlers/submissions.go internal/services/submission_*.go frontend/src/client/submission-draft*.ts frontend/src/submission-draft.tsx

If the preview hits a different handler (e.g. GET /api/projects/{id}/submissions/{code}/preview) that wasn't updated by t-paliad-253, fix it the same way: route it through RenderProjectSubmission (or SubmissionDraftService.Resolve + render-to-HTML).

Candidate C — m is testing a non-de.inf.lg.erwidg submission

Most likely. The fix works only where a per-submission template is wired. For ANY other code, the universal .dotm fallback (no placeholders) is hit and the preview shows the bare letterhead — exactly what m describes.

Fix: Author at least ONE more template that's universally useful as a fallback. Pick whichever of these is cleanest:

  1. _skeleton.docx — a universal skeleton template per the existing fallback chain slot 3 (templates/_base/_skeleton.docx). Contains the firm header + every standard {{...}} placeholder block (case caption, parties, today, firm.name, project.case_number, etc.) plus a generic placeholder body ({{submission.body}} or similar). Lawyers can copy + adapt. Recommended (R) — kills the universal-no-variables case for every code without a per-submission template.
  2. Enrich the universal HL Patents Style.dotm itself with placeholders. Risk: that file is firm-wide letterhead m's people may rely on independently. Don't do this.
  3. Author 3-5 more per-submission templates (UPC SoC, UPC SoD, EPO Opposition, DPMA Klage, …). Heavy lift; better as follow-up.

Default to (1) — _skeleton.docx. Reuses brunel's scripts/gen-demo-submission-template script structure to generate the bytes; commit to m/mWorkRepo at 6 - material/Templates/Word/Paliad/HLC/_skeleton.docx. Verify the fallback chain in internal/services/submission_templates.go (or wherever) actually consults this path before falling back to the universal .dotm.

What to do

  1. First — verify Candidate A live. If deploy lag, report back, wait for redeploy, retest. If a real bug, continue.
  2. Diagnose Candidate B — find the preview render path; confirm whether it goes through the same code as /generate. If not, route it through RenderProjectSubmission or its sibling.
  3. Address Candidate C — author _skeleton.docx per (R) above so the universal-no-variables case is killed for every code. Wire it in the fallback chain.

Hard rules

  • Don't touch the universal HL Patents Style.dotm — firm-wide letterhead.
  • _skeleton.docx exercises every variable SubmissionVarsService resolves (same 48-key contract brunel established).
  • go build ./... && go test ./internal/... && cd frontend && bun run build clean.
  • Branch: mai/<worker>/preview-skeleton-template.

Out of scope

  • Authoring per-submission templates for specific codes (Slice B).
  • Toggleable passages / structured sections in the template.
  • A template-authoring UI for non-lawyer users.

Reporting

mai report completed with branch + SHAs + which of A/B/C turned out to be the actual root cause (often multiple) + verification path on paliad.de: open any submission code that previously showed only letterhead → confirm preview now renders the skeleton with variables substituted (or the per-submission template if one exists).

## m's report (2026-05-25 14:37) > The submission generation still always shows the preview that was our dotm template file for hl patent style. We should just try it with a NEW template that at least includes some of the variables when generating ## Context - t-paliad-253 / m/paliad#84 (commit `5df87f4`) fixed the `/generate` one-click button — `handleGenerateProjectSubmission` now runs `SubmissionDraftService.RenderProjectSubmission` (vars.Build + renderer.Render) and respects the per-firm `submissionTemplateRegistry`. - ritchie's t-paliad-241 + brunel's #84 extension wired ONE per-firm template (`de.inf.lg.erwidg.docx`) with the full 48-variable placeholder set. - For ALL OTHER submission_codes, the template fallback chain ends at the universal `HL Patents Style.dotm` (letterhead only, NO placeholders). So picking any non-`de.inf.lg.erwidg` code still shows a bare letterhead in the preview. m's report could mean any of three things — diagnose in order: ### Candidate A — deploy lag brunel's fix landed at 12:55 local; subsequent merges (#85 #82 #83 #87 #88) may have queued Dokploy redeploys. paliad.de's container might not yet be on the fix's binary. Check: ```bash curl -s -I https://paliad.de/healthz curl -s https://paliad.de/api/version 2>/dev/null # if exposed # or check the Schriftsätze Bearbeiten for de.inf.lg.erwidg — if variables substitute there # but the preview/generate-button shows empty, deploy lag is the culprit ``` If deploy lag, wait + re-test; no code action. ### Candidate B — preview code path differs from /generate The editor's **preview pane** (HTML rendered in the sidebar/main pane of the Schriftsätze draft editor) might use a different endpoint or render path than `/generate`. Search: ```bash grep -rn 'preview\|Preview\|render_html\|html_render' internal/handlers/submissions.go internal/services/submission_*.go frontend/src/client/submission-draft*.ts frontend/src/submission-draft.tsx ``` If the preview hits a different handler (e.g. `GET /api/projects/{id}/submissions/{code}/preview`) that wasn't updated by t-paliad-253, fix it the same way: route it through `RenderProjectSubmission` (or `SubmissionDraftService.Resolve` + render-to-HTML). ### Candidate C — m is testing a non-`de.inf.lg.erwidg` submission Most likely. The fix works only where a per-submission template is wired. For ANY other code, the universal `.dotm` fallback (no placeholders) is hit and the preview shows the bare letterhead — exactly what m describes. Fix: **Author at least ONE more template that's universally useful as a fallback**. Pick whichever of these is cleanest: 1. **`_skeleton.docx`** — a universal skeleton template per the existing fallback chain slot 3 (`templates/_base/_skeleton.docx`). Contains the firm header + every standard `{{...}}` placeholder block (case caption, parties, today, firm.name, project.case_number, etc.) plus a generic placeholder body (`{{submission.body}}` or similar). Lawyers can copy + adapt. **Recommended (R)** — kills the universal-no-variables case for every code without a per-submission template. 2. **Enrich the universal `HL Patents Style.dotm`** itself with placeholders. Risk: that file is firm-wide letterhead m's people may rely on independently. Don't do this. 3. **Author 3-5 more per-submission templates** (UPC SoC, UPC SoD, EPO Opposition, DPMA Klage, …). Heavy lift; better as follow-up. Default to (1) — `_skeleton.docx`. Reuses brunel's `scripts/gen-demo-submission-template` script structure to generate the bytes; commit to `m/mWorkRepo` at `6 - material/Templates/Word/Paliad/HLC/_skeleton.docx`. Verify the fallback chain in `internal/services/submission_templates.go` (or wherever) actually consults this path before falling back to the universal `.dotm`. ## What to do 1. **First** — verify Candidate A live. If deploy lag, report back, wait for redeploy, retest. If a real bug, continue. 2. **Diagnose Candidate B** — find the preview render path; confirm whether it goes through the same code as /generate. If not, route it through `RenderProjectSubmission` or its sibling. 3. **Address Candidate C** — author `_skeleton.docx` per (R) above so the universal-no-variables case is killed for every code. Wire it in the fallback chain. ## Hard rules - Don't touch the universal `HL Patents Style.dotm` — firm-wide letterhead. - `_skeleton.docx` exercises every variable `SubmissionVarsService` resolves (same 48-key contract brunel established). - `go build ./... && go test ./internal/... && cd frontend && bun run build` clean. - Branch: `mai/<worker>/preview-skeleton-template`. ## Out of scope - Authoring per-submission templates for specific codes (Slice B). - Toggleable passages / structured sections in the template. - A template-authoring UI for non-lawyer users. ## Reporting `mai report completed` with branch + SHAs + which of A/B/C turned out to be the actual root cause (often multiple) + verification path on paliad.de: open any submission code that previously showed only letterhead → confirm preview now renders the skeleton with variables substituted (or the per-submission template if one exists).
mAi self-assigned this 2026-05-25 12:38:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#90
No description provided.