feat(background): subfolder support, per-file context selection, and multimodal image improvements #20

Closed
casper-stevens wants to merge 0 commits from development_bg_panel_improvements into development
Member

Summary

  • Recursive subfolder support in the background panel (create nested folders, drag files between any depth)
  • Top upload button always targets root
  • Drag files back to root by dropping on the root section
  • Per-file context selection in the create-slide modal and instruct panel (expand any folder to pick individual files)
  • Select-all / deselect-all checkbox in both context sections
  • Background context section now appears when only root files exist (no folders needed)
  • Multimodal image generation: smarter directive tells the model to reproduce images verbatim when the slide calls for it, extract data when asked, or use as style reference otherwise
  • All images normalised to PNG before sending to AI (fixes JPEG handling)

Closes #7

Changes

  • discovery.rs: recursive find_background_folders, per-folder file filtering in collect_selected_background_images and read_background_content
  • generator.rs: three-rule image directive replacing the blanket style-reference framing
  • deck_module.rs: slide_create_content and slide_instruct_content accept bg_root_files_csv, bg_folder_files_json
  • generate_job.rs / rpc.rs: new params wired through both create and instruct pipelines
  • dashboard.js: nested tree rendering, subfolder creation, drag-to-root, per-folder file checkboxes in modal and instruct panel, select-all checkbox
  • index.html: select-all checkbox added to both context sections
## Summary - Recursive subfolder support in the background panel (create nested folders, drag files between any depth) - Top upload button always targets root - Drag files back to root by dropping on the root section - Per-file context selection in the create-slide modal and instruct panel (expand any folder to pick individual files) - Select-all / deselect-all checkbox in both context sections - Background context section now appears when only root files exist (no folders needed) - Multimodal image generation: smarter directive tells the model to reproduce images verbatim when the slide calls for it, extract data when asked, or use as style reference otherwise - All images normalised to PNG before sending to AI (fixes JPEG handling) ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_slides/issues/7 ## Changes - `discovery.rs`: recursive `find_background_folders`, per-folder file filtering in `collect_selected_background_images` and `read_background_content` - `generator.rs`: three-rule image directive replacing the blanket style-reference framing - `deck_module.rs`: `slide_create_content` and `slide_instruct_content` accept `bg_root_files_csv`, `bg_folder_files_json` - `generate_job.rs` / `rpc.rs`: new params wired through both create and instruct pipelines - `dashboard.js`: nested tree rendering, subfolder creation, drag-to-root, per-folder file checkboxes in modal and instruct panel, select-all checkbox - `index.html`: select-all checkbox added to both context sections
feat(background): improve panel UX, image upload, root file support, and multimodal AI
Some checks failed
Test / test (push) Failing after 1m5s
Test / test (pull_request) Failing after 1m23s
121e9120bf
- Allow PNG/JPG/JPEG/WEBP/GIF uploads to background panel (was text-only)
- Collapse background panel by default; auto-open when content exists
- Support files directly at content/background/ root (no subfolder needed)
- Include root text files and images in AI generation context
- Pass background images as multimodal input to AI content and image generation
- Add framing prompt so background images inform style/mood, not literal output
- Normalize all images to PNG before passing to AI (fixes JPEG handling)
- Add per-root-file selection checkboxes in create-slide modal
- Fix root file selection key bug in background tree UI

#7
fix(generator): remove framing note that blocked literal image reproduction
Some checks failed
Test / test (pull_request) Failing after 1m5s
Test / test (push) Failing after 1m6s
b64a60677f
The framing prompt told the model never to reproduce background images
literally. This broke the core use case of getting an exact image on a
slide. Per-file selection checkboxes already let users exclude unwanted
images, so the restriction is no longer needed.

#7
feat(background): subfolder support, per-file selection, and instruct context control
Some checks failed
Test / test (pull_request) Failing after 1m7s
Test / test (push) Failing after 1m25s
bcf0bba61c
Background panel:
- Recursive folder discovery — subfolders like "company/team" now visible
- Nested tree rendering with indentation and per-folder expand/collapse
- "Add subfolder" button on every folder node
- Top upload button always targets root (was incorrectly targeting first folder)
- Drag files to root by dropping on the root files section
- Drag files between any folder depth (fixed lastIndexOf parsing for nested paths)
- Context menu "Move to Root" option added

Create-slide modal:
- Per-folder file checkboxes — expand any folder to pick individual files
- Root files still selectable individually as before
- Only selected files passed to AI generation

Instruct panel (slide editor):
- Background context section now shows root files + folders + per-file selection
- Root files individually selectable with checkboxes
- Each folder expandable to pick specific files
- Selected background_root_files and background_folder_files passed through
  the full job pipeline (RPC → generate_job → rhai → deck_module)
- JPEG/WebP images normalized to PNG before passing to AI (consistent with create flow)

#7
fix(background): show context selection when only root files exist
Some checks failed
Test / test (pull_request) Failing after 1m4s
Test / test (push) Failing after 1m10s
ef02d5ca6e
handle_deck_get was only checking find_background_folders (directories)
to set has_background. If a deck had files directly at content/background/
but no subfolders, has_background was false and the context section never
appeared in the create-slide modal or instruct panel.
feat(background): add select all / deselect all toggle to context sections
Some checks failed
Test / test (push) Failing after 1m4s
Test / test (pull_request) Failing after 1m29s
8c068d7443
Adds an 'All'/'None' toggle button to both the create-slide modal and the
instruct panel background context sections. Button label reflects current
state: shows 'None' when everything is selected, 'All' when deselected.
feat(background): add checkmark icon to select-all toggle button
Some checks failed
Test / test (push) Failing after 1m50s
Test / test (pull_request) Failing after 1m51s
8cf5b3cbaf
fix(background): replace toggle button with actual checkbox for select-all
Some checks failed
Test / test (pull_request) Failing after 1m4s
Test / test (push) Failing after 1m7s
c4b7439262
fix(generator): smarter image directive for multimodal slide generation
Some checks failed
Test / test (pull_request) Failing after 1m6s
Test / test (push) Failing after 1m6s
6a40512172
Replaces the blanket "style-reference only" framing with a three-rule
directive that tells the model to read the slide content first and decide:
1. reproduce the image verbatim if the slide calls for it
2. extract information from it if the slide asks for data/text
3. use it as style reference only if the slide doesn't reference it

Also includes discovery and CSS tweaks from the parallel work session.

#7
casper-stevens changed title from feat(background): improve panel UX, image upload, root file support, and multimodal AI to feat(background): subfolder support, per-file context selection, and multimodal image improvements 2026-04-15 09:56:23 +00:00
casper-stevens closed this pull request 2026-04-16 08:52:21 +00:00
Some checks failed
Test / test (pull_request) Failing after 1m6s
Test / test (push) Failing after 1m6s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_slides!20
No description provided.