Skip to content

feat(desktop): channel templates — reusable project settings#538

Merged
wesbillman merged 1 commit into
mainfrom
wes/channel-templates
May 11, 2026
Merged

feat(desktop): channel templates — reusable project settings#538
wesbillman merged 1 commit into
mainfrom
wes/channel-templates

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

  • Channel templates that pre-configure channel type, visibility, canvas content, and agent roster — managed in Settings → Channel Templates
  • Async agent startup: after creating a channel from a template, navigation is instant — agents spin up in the background via fire-and-forget Promise.allSettled (parallel, not sequential)
  • Extracted useApplyTemplate hook: template canvas + agent apply logic pulled out of AppShell into a dedicated hook, reducing AppShell by ~150 lines
  • Rust backend: local JSON storage for templates with full CRUD via Tauri IPC

Details

  • Apply flow: create channel → set canvas → navigate → (background) create agents → invalidate caches → toast on failures
  • Provider/model resolution: template entry → persona default → user runtime default (first non-null wins)
  • Partial agent failures show a toast warning; agent creation never blocks navigation or the dialog
  • Cache invalidation after background agent creation ensures members sidebar updates immediately
  • Direct-persona dedup prevents duplicate agents when a persona appears in both direct entries and team expansions

NITs noted during review (not addressed)

  • Cache invalidation in useApplyTemplate uses string literals instead of exported query key constants
  • Theoretical stale-closure if persona/provider queries haven't resolved when user submits (unreachable in practice — Tauri queries resolve in ms)

Test plan

  • Create a template in Settings → Channel Templates with personas and teams
  • Create a channel using the template — verify instant navigation, agents appear within seconds
  • Create a template with invalid persona IDs — verify toast warning on partial failures
  • Create a channel without a template — verify no behavioral change
  • Edit, duplicate, and delete templates in settings

🤖 Generated with Claude Code

Add channel templates that pre-configure channel type, visibility,
canvas content, and agent roster. Templates are stored locally as JSON
and managed through Settings → Channel Templates.

Apply flow: create channel → set canvas → navigate → spawn agents
(background, parallel via Promise.allSettled). Partial failures show
a toast warning; agent creation never blocks navigation.

Key implementation details:
- Rust backend: templates/storage.rs (CRUD), commands/channel_templates.rs
  (Tauri IPC), types.rs (serde models)
- TypeScript: useApplyTemplate hook encapsulates canvas + agent apply
  logic, extracted from AppShell (~150 lines removed from AppShell)
- CreateChannelDialog: template selector pre-fills form fields
- Settings: ChannelTemplatesSettingsCard for CRUD management
- Provider/model resolution: template entry → persona default → user
  runtime default (first non-null wins)
- Parallel agent creation via Promise.allSettled with per-agent error
  isolation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesbillman

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-05-11 at 11 54 06 AM Screenshot 2026-05-11 at 11 54 24 AM Screenshot 2026-05-11 at 11 54 38 AM

@wesbillman wesbillman merged commit 1b9f616 into main May 11, 2026
15 checks passed
@wesbillman wesbillman deleted the wes/channel-templates branch May 11, 2026 19:31
tlongwell-block added a commit that referenced this pull request May 11, 2026
…lassification

* origin/main:
  fix: default max_rounds to 0 (unlimited) (#540)
  feat(desktop): channel templates — reusable project settings (#538)
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