Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(vscode): refactor chat panel webview. #3624

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clients/tabby-chat-panel/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export interface OnLoadedParams {
apiVersion: string
}

// @deprecated
export interface ErrorMessage {
title?: string
content: string
Expand Down Expand Up @@ -219,8 +220,11 @@ export interface ServerApi {
*/
executeCommand: (command: ChatCommand) => Promise<void>

// @deprecated
showError: (error: ErrorMessage) => void
// @deprecated
cleanError: () => void

Comment on lines +223 to +227
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated showError and cleanError. Errors will now be displayed on a client-side defined page instead of being sent to the server for rendering.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addRelevantContext: (context: EditorContext) => void
updateTheme: (style: string, themeClass: string) => void
updateActiveSelection: (context: EditorContext | null) => void
Expand Down
16 changes: 6 additions & 10 deletions clients/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,19 +394,13 @@
"command": "tabby.chat.addRelevantContext",
"key": "ctrl+l",
"mac": "cmd+l",
"when": "editorHasSelection && editorTextFocus && tabby.chatEnabled"
"when": "tabby.chatEnabled && editorTextFocus && editorHasSelection && tabby.chatSidePanelVisible"
},
{
"command": "tabby.chatView.focus",
"command": "tabby.chat.toggleFocus",
"key": "ctrl+l",
"mac": "cmd+l",
"when": "!editorHasSelection && editorTextFocus && tabby.chatEnabled"
},
{
"command": "workbench.action.focusActiveEditorGroup",
"key": "ctrl+l",
"mac": "cmd+l",
"when": "!editorFocus && focusedView == 'tabby.chatView'"
"when": "(tabby.chatEnabled && editorTextFocus && !tabby.chatSidePanelVisible) || ((!editorTextFocus || (editorTextFocus && !editorHasSelection)) && tabby.chatSidePanelVisible)"
}
],
"viewsContainers": {
Expand Down Expand Up @@ -449,14 +443,14 @@
"publish-prerelease": "pnpm run vscode:publish-prerelease && pnpm run ovsx:publish-prerelease"
},
"devDependencies": {
"tabby-threads": "workspace:*",
"@types/deep-equal": "^1.0.4",
"@types/diff": "^5.2.1",
"@types/fs-extra": "^11.0.1",
"@types/mocha": "^10.0.1",
"@types/node": "18.x",
"@types/object-hash": "^3.0.0",
"@types/semver": "^7.5.8",
"@types/uuid": "^9.0.0",
"@types/vscode": "^1.82.0",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
Expand All @@ -479,9 +473,11 @@
"semver": "^7.6.0",
"tabby-agent": "workspace:*",
"tabby-chat-panel": "workspace:*",
"tabby-threads": "workspace:*",
"tsc-watch": "^6.2.0",
"tsup": "^8.0.2",
"typescript": "^5.3.2",
"uuid": "^9.0.0",
"vscode-languageclient": "^9.0.1"
}
}
10 changes: 10 additions & 0 deletions clients/vscode/src/ContextVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class ContextVariables {
private chatEditInProgressValue = false;
private chatEditResolvingValue = false;
private inlineCompletionTriggerModeValue: "automatic" | "manual" = "automatic";
private chatSidePanelVisibleValue = false;

constructor(
private readonly client: Client,
Expand Down Expand Up @@ -84,4 +85,13 @@ export class ContextVariables {
commands.executeCommand("setContext", "tabby.inlineCompletionTriggerMode", value);
this.inlineCompletionTriggerModeValue = value;
}

get chatSidePanelVisible(): boolean {
return this.chatSidePanelVisibleValue;
}

set chatSidePanelVisible(value: boolean) {
commands.executeCommand("setContext", "tabby.chatSidePanelVisible", value);
this.chatSidePanelVisibleValue = value;
}
}
67 changes: 0 additions & 67 deletions clients/vscode/src/chat/ChatPanelViewProvider.ts

This file was deleted.

70 changes: 0 additions & 70 deletions clients/vscode/src/chat/ChatSideViewProvider.ts

This file was deleted.

Loading
Loading