Fix instructions tab state on agent switch
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
eda69fed74
commit
334e7e61b5
1 changed files with 15 additions and 0 deletions
|
|
@ -998,6 +998,7 @@ export function AgentDetail() {
|
||||||
|
|
||||||
{activeView === "instructions" && (
|
{activeView === "instructions" && (
|
||||||
<PromptsTab
|
<PromptsTab
|
||||||
|
key={agent.id}
|
||||||
agent={agent}
|
agent={agent}
|
||||||
companyId={resolvedCompanyId ?? undefined}
|
companyId={resolvedCompanyId ?? undefined}
|
||||||
onDirtyChange={setConfigDirty}
|
onDirtyChange={setConfigDirty}
|
||||||
|
|
@ -1617,6 +1618,20 @@ function PromptsTab({
|
||||||
selectedFile: string;
|
selectedFile: string;
|
||||||
} | null>(null);
|
} | 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 =
|
const isLocal =
|
||||||
agent.adapterType === "claude_local" ||
|
agent.adapterType === "claude_local" ||
|
||||||
agent.adapterType === "codex_local" ||
|
agent.adapterType === "codex_local" ||
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue