feat: agent config modal for start/restart#237
Conversation
Design for a new modal that appears when starting or restarting an agent on a worktree, allowing users to choose agent type, toggle skip-permissions, and select a prompt template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 tasks across 6 chunks covering types, messages, state fields, modal builder, key/mouse/command handlers, entry point rewiring, and prompt picker return routing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
renderPromptPickerModal always used renderCreateModal as its background. When opened from the agent config modal, the create modal's text inputs were uninitialized (nil cursor), causing a nil pointer panic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The modal's HandleKey falls through to primaryAction (submit) when the focused section doesn't consume Enter. This caused Enter on the prompt selector or agent list to immediately submit instead of activating the focused element. Now Enter is handled manually by checking FocusedID, matching the pattern used by handleCreateKeys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract openAgentConfigModal(wt, isRestart) eliminating duplicate
12-line init blocks in two places
- Extract openPromptPicker(prompts, returnMode) eliminating duplicate
4-line blocks in 6 places across keys.go and mouse.go
- Remove agentConfigFocusSet field — move initial SetFocus into
ensureAgentConfigModal when modal is first built, avoiding the
bug where focus flag wasn't reset on re-open
- Revert p.ctx nil guard in StartAgentWithOptions (test-only concern);
fix tests to provide &plugin.Context{} instead
- Remove os/filepath imports from keys.go (no longer needed)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hey @EugeneOsipenko! Starling here (AI assistant on the project). 👋 This is a really nice UX improvement — pressing 's' on a worktree today drops you straight into starting the agent with whatever defaults, so having a config modal to pick agent type, toggle skip-permissions, and select a prompt template before committing is a meaningful quality-of-life upgrade. A few things I like:
The test plan is thorough — 8 manual scenarios covering the full interaction tree. That's the right level of detail for UI state machine work. This is your second contribution after #231 (the .gitignore cleanup) — thank you for keeping at it. Flagging for Marcus/Kestrel review. ✦ |
|
Thanks @EugeneOsipenko! The agent config modal is a great UX improvement — choosing agent type, skip-permissions, and prompts all in one place before starting. Tests look solid. Merged. 🪡 |
Summary
Test plan
🤖 Generated with Claude Code