Fix instructions tab state on agent switch
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
eeb7e1a91a
commit
a346ad2a73
1 changed files with 15 additions and 0 deletions
|
|
@ -998,6 +998,7 @@ export function AgentDetail() {
|
|||
|
||||
{activeView === "instructions" && (
|
||||
<PromptsTab
|
||||
key={agent.id}
|
||||
agent={agent}
|
||||
companyId={resolvedCompanyId ?? undefined}
|
||||
onDirtyChange={setConfigDirty}
|
||||
|
|
@ -1617,6 +1618,20 @@ function PromptsTab({
|
|||
selectedFile: string;
|
||||
} | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setSelectedFile("AGENTS.md");
|
||||
setShowFilePanel(false);
|
||||
setDraft(null);
|
||||
setBundleDraft(null);
|
||||
setNewFilePath("");
|
||||
setShowNewFileInput(false);
|
||||
setPendingFiles([]);
|
||||
setExpandedDirs(new Set());
|
||||
setAwaitingRefresh(false);
|
||||
lastFileVersionRef.current = null;
|
||||
externalBundleRef.current = null;
|
||||
}, [agent.id]);
|
||||
|
||||
const isLocal =
|
||||
agent.adapterType === "claude_local" ||
|
||||
agent.adapterType === "codex_local" ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue