Skip to content

fix: resolve user templates in remote PPTX generation - #279

Merged
ShotaroKataoka merged 1 commit into
mainfrom
fix/user-template-resolution-206
Aug 4, 2026
Merged

fix: resolve user templates in remote PPTX generation#279
ShotaroKataoka merged 1 commit into
mainfrom
fix/user-template-resolution-206

Conversation

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

Summary

Fixes #206 — custom templates uploaded via the Web UI were silently ignored during PPTX generation on AWS (Layer 3/4), falling back to blank-dark.pptx with no warning.

Root cause

Template resolution in _prepare_workspace() (servers/remote/tools/generate.py) only matched against storage.list_templates() (builtin templates). User templates were never searched, and the unresolved name silently fell back to the default.

Changes

  • Resolve user templates first via get_user_template_metadata / download_user_template — same resolution order as analyze_template
  • Raise ValueError (with the available template list, same format as analyze_template) when an explicitly referenced template cannot be resolved — no more silent wrong-design fallback
  • Remove the deck.get("templateS3Key") fallback: never set by production code (create_deck), it existed only in the test fixture
  • Keep the blank-dark.pptx default when no template is specified (unchanged behavior)

_prepare_workspace is shared by generate_pptx and the compose/preview verify pass, so one fix covers both paths.

Testing

  • 3 new unit tests: user template resolution, unresolvable name → error, empty template → default (regression)
  • Test fixture updated to match production deck records (dropped templateS3Key)
  • make lint / make test pass (758 passed, 5 skipped)
  • Verified end-to-end on AWS: deck referencing an uploaded user template now builds with that template (52 layouts + media present in the generated PPTX; fonts extracted from the user template)

Out of scope

  • Local server (servers/local) — separate logic, unaffected
  • Per-slide background overrides written by composers can still hide a template's background image; that is spec-driven behavior, not a resolution bug (can be tracked separately)

…erate

The remote server's template resolution in _prepare_workspace() only
searched builtin templates (storage.list_templates()), so a deck
referencing an uploaded user template silently fell back to
blank-dark.pptx with no warning.

- Resolve user templates first via get_user_template_metadata /
  download_user_template (same order as analyze_template)
- Raise ValueError with available template list when an explicitly
  referenced template cannot be resolved (no more silent fallback)
- Drop the templateS3Key fallback (never set by production code)
- Keep blank-dark default when no template is specified

Fixes #206

SPEC: 20260804-1420_fix-user-template-resolution-generate
@ShotaroKataoka ShotaroKataoka added the blog:skip ブログ対象外 label Aug 4, 2026
@ShotaroKataoka
ShotaroKataoka merged commit 9fc1d8d into main Aug 4, 2026
15 of 16 checks passed
@ShotaroKataoka
ShotaroKataoka deleted the fix/user-template-resolution-206 branch August 4, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blog:skip ブログ対象外

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: アップロードしたカスタムテンプレートが生成に反映されず blank-dark にフォールバックする(AWS環境)

1 participant