mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
## Problem On the `/agents/:agentId` detail page, text typed into the chat input was lost when navigating away and returning. The empty-state page (`/agents`) already persisted drafts via `localStorage`, but individual conversation pages did not. ## Solution Adds per-conversation draft persistence to `useConversationEditingState` in `AgentDetail.tsx`, following the same patterns used elsewhere in the agents page: - Drafts are stored under `agents.draft-input.<chatID>` keys - The saved draft is read as the editor's initial value on mount - `localStorage` is updated on every content change - The key is removed when the input is cleared or a message is sent successfully