feat: fall back to image provider when path: slot doesn't resolve#26
Merged
Conversation
…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>
98e803f to
e7a2558
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pptx_emit.py: when apicture 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 writeimage: "regensburg aerial"directly — noquery:keyword in layout DSL files required._resolve_provider_image(): deduplicates the search → materialise → error-record loop that was duplicated between thequery:branch and the newpath:fallback.$image_provider: unsplashas the default forfeinschliff,blank, andclaudebrand packs (requiresUNSPLASH_ACCESS_KEYin environment).Why
The
path:vsquery: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 passedfeinschliff deck build <plan>withUNSPLASH_ACCESS_KEYset and search strings inimage:slots builds successfullyfeinschliff deck build <plan>without provider active still reportsmissing-fileas before (no regression)feinschliff deck build <plan>with explicitquery:in layout DSL continues to work unchanged🤖 Generated with Claude Code