fix(dashboard): prevent cross-agent overwrite from stale Config tab autosave
Switching agents in the AgentsView split layout while on the Config tab
caused the autosave to write the previously-viewed agent's surface fields
(name, role, title, icon, model, skills) onto the newly-selected agent.
The Config tab's form state was initialized once at mount and never
resynced, while the master-detail layout reused the same component
instance across selections. Add key={selectedAgentId} on AgentDetailView
and key={agent.id} on ConfigTab so both remount with fresh state on every
agent transition.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -704,7 +704,8 @@ export function AgentDetailView({ agentId, projectId, onClose, addToast, onChild
|
||||
)}
|
||||
|
||||
{activeTab === "config" && (
|
||||
<ConfigTab
|
||||
<ConfigTab
|
||||
key={agent.id}
|
||||
agent={agent}
|
||||
projectId={projectId}
|
||||
addToast={addToast}
|
||||
|
||||
@@ -1459,6 +1459,7 @@ export function AgentsView({ addToast, projectId, onOpenTaskLogs, agentOnboardin
|
||||
{selectedAgentId ? (
|
||||
<Suspense fallback={null}>
|
||||
<AgentDetailView
|
||||
key={selectedAgentId}
|
||||
inline
|
||||
showInlineBackButton={isMobileViewport}
|
||||
agentId={selectedAgentId}
|
||||
|
||||
Reference in New Issue
Block a user