Skip to content

Commit d339c61

Browse files
committed
Optimize AI Studio temporary chat toggling and ensure proper disposal of inline completion listeners
1 parent 58b8d0e commit d339c61

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"prepare": "husky"
1111
},
1212
"lint-staged": {
13-
"*.{js,jsx,ts,tsx,json,css,scss,md,html,vue}": [
13+
"*.{ts,tsx,json,css,scss,md}": [
1414
"prettier --write"
1515
]
1616
}

‎packages/browser/src/content-scripts/send-prompt-content-script/chatbots/ai-studio.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ export const ai_studio: Chatbot = {
207207
})
208208
return
209209
}
210-
temp_toggle.click()
210+
if (!temp_toggle.classList.contains('ms-button-active')) {
211+
temp_toggle.click()
212+
}
211213
}
212214

213215
if (supported_options['grounding-with-google-search']) {

‎packages/browser/src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Code Web Chat Connector",
55
"short_name": "CWC",
66
"description": "Connect your editor with free chatbots. Include websites in context.",
7-
"version": "1.46.0",
7+
"version": "1.47.0",
88
"homepage_url": "https://github.com/robertpiosik/CodeWebChat",
99
"icons": {
1010
"16": "icons/icon-16.png",

‎packages/vscode/src/commands/code-completion-commands.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const show_inline_completion = async (params: {
4141
'editor.action.formatDocument',
4242
document.uri
4343
)
44+
controller.dispose()
4445
change_listener.dispose()
4546
}
4647
}
@@ -476,6 +477,8 @@ const perform_code_completion = async (params: {
476477
.replace(/<!\[CDATA\[/g, '')
477478
.replace(/\]\]>/g, '')
478479
.trim()
480+
481+
console.log('xxx', Date.now())
479482
await show_inline_completion({
480483
editor,
481484
position,

0 commit comments

Comments
 (0)