docs: Add plan for Project-Specific Agent Instructions feature
- Create comprehensive plan document for agent instructions text area - Define requirements, acceptance criteria, and technical implementation - Include UI/UX mockups and testing strategy - Plan discovered during FILES panel implementation - Addresses need for project-specific acceptance criteria
This commit is contained in:
parent
c05c7f5a61
commit
0a510de487
@ -53,11 +53,17 @@ export default function FileTree({ workspaceMode, onFileSelect }: FileTreeProps)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(prev => ({
|
setState(prev => {
|
||||||
...prev,
|
const newLoading = new Set(prev.loadingPaths);
|
||||||
loadingPaths: new Set(prev.loadingPaths).add(path),
|
newLoading.add(path);
|
||||||
errors: new Map(prev.errors).delete(path),
|
const newErrors = new Map(prev.errors);
|
||||||
}));
|
newErrors.delete(path);
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
loadingPaths: newLoading,
|
||||||
|
errors: newErrors,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await socketClient.requestFileTree({
|
const result = await socketClient.requestFileTree({
|
||||||
@ -67,24 +73,42 @@ export default function FileTree({ workspaceMode, onFileSelect }: FileTreeProps)
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (result.success && result.entries) {
|
if (result.success && result.entries) {
|
||||||
setState(prev => ({
|
setState(prev => {
|
||||||
...prev,
|
const newCache = new Map(prev.directoryCache);
|
||||||
directoryCache: new Map(prev.directoryCache).set(path, result.entries!),
|
newCache.set(path, result.entries!);
|
||||||
loadingPaths: new Set(prev.loadingPaths).delete(path),
|
const newLoading = new Set(prev.loadingPaths);
|
||||||
}));
|
newLoading.delete(path);
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
directoryCache: newCache,
|
||||||
|
loadingPaths: newLoading,
|
||||||
|
};
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setState(prev => ({
|
setState(prev => {
|
||||||
...prev,
|
const newErrors = new Map(prev.errors);
|
||||||
errors: new Map(prev.errors).set(path, result.error || 'Failed to load directory'),
|
newErrors.set(path, result.error || 'Failed to load directory');
|
||||||
loadingPaths: new Set(prev.loadingPaths).delete(path),
|
const newLoading = new Set(prev.loadingPaths);
|
||||||
}));
|
newLoading.delete(path);
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
errors: newErrors,
|
||||||
|
loadingPaths: newLoading,
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setState(prev => ({
|
setState(prev => {
|
||||||
...prev,
|
const newErrors = new Map(prev.errors);
|
||||||
errors: new Map(prev.errors).set(path, error instanceof Error ? error.message : 'Unknown error'),
|
newErrors.set(path, error instanceof Error ? error.message : 'Unknown error');
|
||||||
loadingPaths: new Set(prev.loadingPaths).delete(path),
|
const newLoading = new Set(prev.loadingPaths);
|
||||||
}));
|
newLoading.delete(path);
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
errors: newErrors,
|
||||||
|
loadingPaths: newLoading,
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, [state.directoryCache, state.loadingPaths]);
|
}, [state.directoryCache, state.loadingPaths]);
|
||||||
|
|
||||||
|
|||||||
@ -436,12 +436,12 @@ export class CodeSession extends SocketSession {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const droneSession = SocketService.getDroneSession(this.selectedDrone);
|
const droneSession = SocketService.getDroneSession(this.selectedDrone);
|
||||||
droneSession.socket.emit("fileTreeRequest", args, (success, data) => {
|
droneSession.socket.emit("fileTreeRequest", args, (success: boolean, data: { entries?: FileTreeEntry[]; error?: string }) => {
|
||||||
// Forward response to IDE
|
// Forward response to IDE
|
||||||
if (success && data.entries) {
|
if (success && data?.entries) {
|
||||||
this.socket.emit("fileTreeResponse", args.path || "", data.entries);
|
this.socket.emit("fileTreeResponse", args.path || "", data.entries);
|
||||||
} else {
|
} else {
|
||||||
this.socket.emit("fileTreeResponse", args.path || "", [], data.error);
|
this.socket.emit("fileTreeResponse", args.path || "", [], data?.error);
|
||||||
}
|
}
|
||||||
cb(success, data);
|
cb(success, data);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -120,6 +120,7 @@ export interface ServerToClientEvents {
|
|||||||
processWorkOrder: ProcessWorkOrderMessage;
|
processWorkOrder: ProcessWorkOrderMessage;
|
||||||
crashRecoveryResponse: CrashRecoveryResponseMessage;
|
crashRecoveryResponse: CrashRecoveryResponseMessage;
|
||||||
requestTermination: RequestTerminationMessage;
|
requestTermination: RequestTerminationMessage;
|
||||||
|
fileTreeRequest: FileTreeRequestMessage;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gadget-code:web => gadget-code:ide
|
* gadget-code:web => gadget-code:ide
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user