fix: filter session context by current directory
Loads sessions from the active workspace directory Fetches session messages using both session ID and directory Resets expanded raw messages when the directory changes
This commit is contained in:
@@ -274,8 +274,12 @@ export const ContextPanelContent: React.FC = () => {
|
|||||||
const [copiedRawMessageId, setCopiedRawMessageId] = React.useState<string | null>(null);
|
const [copiedRawMessageId, setCopiedRawMessageId] = React.useState<string | null>(null);
|
||||||
const copyResetTimeoutRef = React.useRef<number | null>(null);
|
const copyResetTimeoutRef = React.useRef<number | null>(null);
|
||||||
const currentSessionId = useSessionUIStore((state) => state.currentSessionId);
|
const currentSessionId = useSessionUIStore((state) => state.currentSessionId);
|
||||||
const sessions = useSessions();
|
const currentSessionDirectory = useSessionUIStore((state) => state.currentSessionDirectory);
|
||||||
const sessionMessages = useSessionMessageRecords(currentSessionId ?? '');
|
const sessions = useSessions(currentSessionDirectory ?? undefined);
|
||||||
|
const sessionMessages = useSessionMessageRecords(
|
||||||
|
currentSessionId ?? '',
|
||||||
|
currentSessionDirectory ?? undefined,
|
||||||
|
);
|
||||||
const providers = useConfigStore((state) => state.providers);
|
const providers = useConfigStore((state) => state.providers);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
@@ -285,7 +289,7 @@ export const ContextPanelContent: React.FC = () => {
|
|||||||
}
|
}
|
||||||
setExpandedRawMessages((prev) => (Object.keys(prev).length > 0 ? {} : prev));
|
setExpandedRawMessages((prev) => (Object.keys(prev).length > 0 ? {} : prev));
|
||||||
setCopiedRawMessageId(null);
|
setCopiedRawMessageId(null);
|
||||||
}, [currentSessionId]);
|
}, [currentSessionDirectory, currentSessionId]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user