Skip to content

feat: fall back to image provider when path: slot doesn't resolve#26

Merged
marsmike merged 1 commit into
mainfrom
feat/unsplash-path-fallback
May 22, 2026
Merged

feat: fall back to image provider when path: slot doesn't resolve#26
marsmike merged 1 commit into
mainfrom
feat/unsplash-path-fallback

Conversation

@marsmike
Copy link
Copy Markdown
Owner

Summary

  • pptx_emit.py: when a picture path:{{ value }} node fails to find the value on the filesystem and an image provider is active, the value is now passed to the provider as a search query. Plan authors can write image: "regensburg aerial" directly — no query: keyword in layout DSL files required.
  • Extract _resolve_provider_image(): deduplicates the search → materialise → error-record loop that was duplicated between the query: branch and the new path: fallback.
  • Brand tokens: enable $image_provider: unsplash as the default for feinschliff, blank, and claude brand packs (requires UNSPLASH_ACCESS_KEY in environment).

Why

The path: vs query: distinction was a DSL-level implementation detail that leaked into layout authoring. Layout files had to declare upfront whether an image came from disk or a search provider, but that is a plan-time concern — the layout just needs a picture. This change makes the resolution transparent: local paths work as before; anything that doesn't resolve to a file falls through to the active provider.

Test plan

  • uv run pytest feinschliff/tests/test_layout_text_picture.py feinschliff/tests/test_image_provider.py feinschliff/tests/test_unsplash_provider.py — 28 passed
  • feinschliff deck build <plan> with UNSPLASH_ACCESS_KEY set and search strings in image: slots builds successfully
  • feinschliff deck build <plan> without provider active still reports missing-file as before (no regression)
  • feinschliff deck build <plan> with explicit query: in layout DSL continues to work unchanged

🤖 Generated with Claude Code

…a file

When a `picture path:{{ value }}` node fails to find the value on the
filesystem and an image provider is active (e.g. Unsplash), the value is
now passed to the provider as a search query instead of recording a
missing-file error. This lets plan authors write plain search strings in
`image:` slots without needing `query:` in every layout DSL file.

Extract `_resolve_provider_image()` helper to deduplicate the
search → materialise → error-record loop shared by the `query:` branch
and the new `path:` fallback.

Enable Unsplash as the default `$image_provider` for the feinschliff,
blank, and claude brand packs (requires UNSPLASH_ACCESS_KEY in env).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Mike Mueller <mike@objektarium.de>
@marsmike marsmike force-pushed the feat/unsplash-path-fallback branch from 98e803f to e7a2558 Compare May 22, 2026 09:51
@marsmike marsmike merged commit 110e33d into main May 22, 2026
3 checks passed
@marsmike marsmike deleted the feat/unsplash-path-fallback branch May 22, 2026 09:52
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