feat(ai): add Instruct flow to theme and instructions editors #14

Merged
casper-stevens merged 1 commit from development_instruct_theme_and_instructions into development 2026-04-14 09:56:31 +00:00
Member

Summary

  • Port the slide-level Instruct pattern (toggleable panel, voice dictation, background-folder context, async-job polling) to the theme and instructions editors
  • Remove the always-visible Theme AI Instruction panel so the theme editor layout matches the instructions editor
  • Drop the user_instruction param from deck.fixTheme / deck.rewriteTheme now that guidance flows through the dedicated Instruct panel
  • Fix a CSS gap: extend the column-flex rule to the theme and instructions overlays so their instruct panels sit below the textarea (not alongside it)

Closes #4

Changes

New prompts

  • system_instruct_theme.md, system_instruct_instructions.md (registered in ALL_TEMPLATES)

Backend

  • handle_instruct_theme, handle_instruct_instructions in agent.rs
  • Ten new RPC methods wired in rpc.rs covering sync + async (Async, JobStatus, JobLogs, Result)
  • Async-job submit helpers and handlers in generate_job.rs
  • Generator helpers instruct_theme_content / instruct_instructions_content in hero_slides_lib
  • Cleanup: user_instruction removed from fix/rewrite theme handlers

Rhai and CLI

  • instruct_theme.rhai, instruct_instructions.rhai scripts
  • Registered deck_instruct_theme / deck_instruct_instructions Rhai bindings
  • Added instruct_theme and instruct_instructions arms in the CLI --run dispatcher

OpenRPC

  • Ten new method entries in openrpc.json
  • Typed client entries in openrpc.client.generated.rs

Frontend

  • Topbar Instruct buttons and hidden instruct panels added to both theme and instructions editors
  • 16 new JS functions (toggle, bg-folder loading, execute, voice dictation) for both editors
  • openThemeEditor / openInstructionsEditor reset their panels on open
  • Instructions editor Instruct flow integrates with instrHistoryPush so AI-applied content becomes an undoable history entry
  • Theme editor: removed always-visible AI Instruction panel and related voice helpers
  • CSS: column-flex rule extended to all three overlays

Test Results

  • cargo check --workspace: clean (one pre-existing unrelated unused-imports warning)
  • cargo test --workspace: 62 passed, 0 failed, 1 ignored (AI-gated integration test)
## Summary - Port the slide-level Instruct pattern (toggleable panel, voice dictation, background-folder context, async-job polling) to the theme and instructions editors - Remove the always-visible Theme AI Instruction panel so the theme editor layout matches the instructions editor - Drop the `user_instruction` param from `deck.fixTheme` / `deck.rewriteTheme` now that guidance flows through the dedicated Instruct panel - Fix a CSS gap: extend the column-flex rule to the theme and instructions overlays so their instruct panels sit below the textarea (not alongside it) ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_slides/issues/4 ## Changes **New prompts** - `system_instruct_theme.md`, `system_instruct_instructions.md` (registered in `ALL_TEMPLATES`) **Backend** - `handle_instruct_theme`, `handle_instruct_instructions` in `agent.rs` - Ten new RPC methods wired in `rpc.rs` covering sync + async (`Async`, `JobStatus`, `JobLogs`, `Result`) - Async-job submit helpers and handlers in `generate_job.rs` - Generator helpers `instruct_theme_content` / `instruct_instructions_content` in `hero_slides_lib` - Cleanup: `user_instruction` removed from fix/rewrite theme handlers **Rhai and CLI** - `instruct_theme.rhai`, `instruct_instructions.rhai` scripts - Registered `deck_instruct_theme` / `deck_instruct_instructions` Rhai bindings - Added `instruct_theme` and `instruct_instructions` arms in the CLI `--run` dispatcher **OpenRPC** - Ten new method entries in `openrpc.json` - Typed client entries in `openrpc.client.generated.rs` **Frontend** - Topbar `Instruct` buttons and hidden instruct panels added to both theme and instructions editors - 16 new JS functions (toggle, bg-folder loading, execute, voice dictation) for both editors - `openThemeEditor` / `openInstructionsEditor` reset their panels on open - Instructions editor Instruct flow integrates with `instrHistoryPush` so AI-applied content becomes an undoable history entry - Theme editor: removed always-visible AI Instruction panel and related voice helpers - CSS: column-flex rule extended to all three overlays ## Test Results - `cargo check --workspace`: clean (one pre-existing unrelated unused-imports warning) - `cargo test --workspace`: 62 passed, 0 failed, 1 ignored (AI-gated integration test)
feat(ai): add Instruct flow to theme and instructions editors
Some checks failed
Test / test (push) Failing after 1m12s
Test / test (pull_request) Failing after 1m16s
f01cd08105
Port the slide-level Instruct pattern (toggleable panel, voice
dictation, background-folder context, async-job polling) to the
theme and instructions editors. Remove the always-visible theme
AI Instruction panel so the layout matches the instructions
editor. Drop the user_instruction param from deck.fixTheme and
deck.rewriteTheme now that guidance flows through the dedicated
Instruct panel.

Adds ten new RPC methods (deck.instructTheme* and
deck.instructInstructions*), matching prompt templates, Rhai
scripts, CLI run arms, and OpenRPC spec entries.

#4
casper-stevens merged commit 34bdd5fa7e into development 2026-04-14 09:56:31 +00:00
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!14
No description provided.