fix: keep selected session header details stable
- Prevent header flicker to Untitled during session refresh - Resolve header session data from global sessions first - Pass session directory hints on more session-switch paths
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { RiArrowLeftLine } from '@remixicon/react';
|
||||
import type { Message, Part } from '@opencode-ai/sdk/v2';
|
||||
import type { Message, Part, Session } from '@opencode-ai/sdk/v2';
|
||||
|
||||
import { ChatInput } from './ChatInput';
|
||||
import { useUIStore } from '@/stores/useUIStore';
|
||||
@@ -191,7 +191,8 @@ export const ChatContainer: React.FC = () => {
|
||||
|
||||
const handleReturnToParentSession = React.useCallback(() => {
|
||||
if (!parentSession) return;
|
||||
setCurrentSession(parentSession.id);
|
||||
const parentDirectory = (parentSession as Session & { directory?: string | null }).directory ?? null;
|
||||
setCurrentSession(parentSession.id, parentDirectory);
|
||||
}, [parentSession, setCurrentSession]);
|
||||
|
||||
const returnToParentButton = parentSession ? (
|
||||
|
||||
Reference in New Issue
Block a user