refactor: remove unused commands and visibility handling from ChatViewProvider

This commit is contained in:
Bohdan Triapitsyn
2025-12-13 21:14:18 +02:00
parent 8c25908d0a
commit 4df60f3ee6
3 changed files with 6 additions and 65 deletions
-16
View File
@@ -7,7 +7,6 @@ export class ChatViewProvider implements vscode.WebviewViewProvider {
public static readonly viewType = 'openchamber.chatView';
private _view?: vscode.WebviewView;
private _isVisible = false;
constructor(
private readonly _context: vscode.ExtensionContext,
@@ -19,11 +18,6 @@ export class ChatViewProvider implements vscode.WebviewViewProvider {
webviewView: vscode.WebviewView
) {
this._view = webviewView;
this._isVisible = webviewView.visible;
webviewView.onDidChangeVisibility(() => {
this._isVisible = webviewView.visible;
});
const distUri = vscode.Uri.joinPath(this._extensionUri, 'dist');
@@ -47,12 +41,6 @@ export class ChatViewProvider implements vscode.WebviewViewProvider {
});
}
public newSession() {
if (this._view) {
this._view.webview.postMessage({ type: 'command', command: 'newSession' });
}
}
public updateTheme(kind: vscode.ColorThemeKind) {
if (this._view) {
const themeKind = getThemeKindName(kind);
@@ -73,10 +61,6 @@ export class ChatViewProvider implements vscode.WebviewViewProvider {
}
}
public isVisible(): boolean {
return this._isVisible;
}
private _getHtmlForWebview(webview: vscode.Webview) {
const scriptPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview', 'assets', 'index.js');
const scriptUri = webview.asWebviewUri(scriptPath);