feat(vscode): add session editor panel (#146)

Add command to open active session in editor panel.
Introduce editor view mode for displaying sessions alongside files.
Update toolbar navigation for editor and sidebar modes.
This commit is contained in:
Bohdan Triapitsyn
2026-01-14 17:13:47 +02:00
committed by GitHub
parent c52a5f27a2
commit 032229c7a2
7 changed files with 692 additions and 9 deletions
+15 -2
View File
@@ -11,10 +11,21 @@ export interface WebviewHtmlOptions {
initialStatus: ConnectionStatus;
cliAvailable: boolean;
panelType?: PanelType;
initialSessionId?: string;
viewMode?: 'sidebar' | 'editor';
}
export function getWebviewHtml(options: WebviewHtmlOptions): string {
const { webview, extensionUri, workspaceFolder, initialStatus, cliAvailable, panelType = 'chat' } = options;
const {
webview,
extensionUri,
workspaceFolder,
initialStatus,
cliAvailable,
panelType = 'chat',
initialSessionId,
viewMode = 'sidebar',
} = options;
const scriptPath = vscode.Uri.joinPath(extensionUri, 'dist', 'webview', 'assets', 'index.js');
const scriptUri = webview.asWebviewUri(scriptPath);
@@ -131,7 +142,9 @@ export function getWebviewHtml(options: WebviewHtmlOptions): string {
theme: "${themeKind}",
connectionStatus: "${initialStatus}",
cliAvailable: ${cliAvailable},
panelType: "${panelType}"
panelType: "${panelType}",
viewMode: "${viewMode}",
initialSessionId: ${initialSessionId ? `"${initialSessionId.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"` : 'null'},
};
window.__OPENCHAMBER_HOME__ = "${workspaceFolder.replace(/\\/g, '\\\\')}";