diff --git a/packages/ui/src/components/layout/VSCodeLayout.tsx b/packages/ui/src/components/layout/VSCodeLayout.tsx index 4467a453..bf4f1c7f 100644 --- a/packages/ui/src/components/layout/VSCodeLayout.tsx +++ b/packages/ui/src/components/layout/VSCodeLayout.tsx @@ -187,6 +187,19 @@ export const VSCodeLayout: React.FC = () => { void vscodeApi.executeCommand('openchamber.setActiveSession', currentSessionId, activeSessionTitle); }, [activeSessionTitle, currentSessionId, runtimeApis.vscode]); + React.useEffect(() => { + if (viewMode !== 'editor' || !currentSessionId || !activeSessionTitle) { + return; + } + + const vscodeApi = runtimeApis.vscode; + if (!vscodeApi) { + return; + } + + void vscodeApi.executeCommand('openchamber.updateSessionEditorTitle', currentSessionId, activeSessionTitle); + }, [activeSessionTitle, currentSessionId, runtimeApis.vscode, viewMode]); + // If the active session disappears (e.g., deleted), go back to sessions list React.useEffect(() => { if (viewMode === 'editor') { @@ -709,7 +722,7 @@ const VSCodeHeader: React.FC = ({ title, showBack, onBack, on @@ -717,6 +730,7 @@ const VSCodeHeader: React.FC = ({ title, showBack, onBack, on ) : (

{title}

)} +
{onNewSession && ( + + + {t('sessions.sidebar.session.actions.openInEditor')} + + + ) : null}