Skip to content

feat(templates): add auto-run toggle for templates#217

Closed
JiahaoZhu11 wants to merge 4 commits intodifferent-ai:devfrom
JiahaoZhu11:feature/template-auto-run-switch
Closed

feat(templates): add auto-run toggle for templates#217
JiahaoZhu11 wants to merge 4 commits intodifferent-ai:devfrom
JiahaoZhu11:feature/template-auto-run-switch

Conversation

@JiahaoZhu11
Copy link
Contributor

Summary

  • Add autoRun toggle to template modal allowing users to control whether templates auto-execute
  • When autoRun is disabled, template creates session but populates prompt input for user review
  • Persist autoRun setting to workspace template YAML files

Changes

Frontend (TypeScript/SolidJS)

  • types.ts - Add autoRun?: boolean to Template type
  • utils/templates.ts - Add autoRun to draft types and functions
  • template-state.ts - Add signal, parsing from YAML/JSON, respect flag in runTemplate
  • template-modal.tsx - Add On/Off toggle button UI
  • app.tsx - Wire up props + setPrompt event listener
  • en.ts / zh.ts - Add i18n translations

Backend (Rust/Tauri)

  • types.rs - Add auto_run: Option<bool> with serde default
  • templates.rs - Serialize autoRun to YAML, pass through in write_template

Test Plan

  • Create template with auto-run ON, verify it auto-executes
  • Create template with auto-run OFF, verify prompt populates but doesn't send
  • Close and reopen app, verify autoRun setting persists

Add ability to control whether templates automatically run when selected or just populate the prompt input for manual review.

Changes:
- Add auto-run toggle (On/Off) in template creation modal with hint text
- Persist autoRun setting in Rust backend (workspace/templates.rs)
- Update template YAML frontmatter serialization to include autoRun field
- Set default workspace templates to auto-run enabled
- Fix bug where YAML frontmatter parser returned string values ("true"/"false")
  instead of booleans, causing autoRun: false to be ignored

When autoRun is disabled, the template prompt is populated in the input
field but not automatically sent, allowing users to review/edit before
submitting.
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

@JiahaoZhu11 JiahaoZhu11 marked this pull request as ready for review January 23, 2026 20:07
@JiahaoZhu11
Copy link
Contributor Author

Closing in favor of #224, which includes this auto-run toggle feature along with additional quick start templates functionality.

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