Skip to content

Commit 76474a3

Browse files
committed
Remove the reuse last tab setting and related logic
- remove setting 'reuse last tab' as it should be the default behavior - reusing last tab should be default behavior - remove excessive params
1 parent c898ea4 commit 76474a3

14 files changed

Lines changed: 1 addition & 192 deletions

File tree

‎apps/browser/src/background/message-handler.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ const process_next_chat = async () => {
120120

121121
if (
122122
last_opened_tab_id !== undefined &&
123-
current_chat_message.reuse_last_tab &&
124123
is_finished_responding
125124
) {
126125
try {

‎apps/editor/package.json‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -984,11 +984,6 @@
984984
"scope": "resource",
985985
"default": false
986986
},
987-
"codeWebChat.reuseLastTab": {
988-
"type": "boolean",
989-
"scope": "resource",
990-
"default": false
991-
},
992987
"codeWebChat.clearChecksInWorkspaceBehavior": {
993988
"type": "string",
994989
"scope": "resource",

‎apps/editor/src/services/websocket-manager.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ export class WebSocketManager {
376376
config.get<ConfigWebConfigurationFormat[]>('webConfigurations') ?? []
377377
const gemini_user_id = config.get<number | null>('geminiUserId')
378378
const ai_studio_user_id = config.get<number | null>('aiStudioUserId')
379-
const reuse_last_tab = config.get<boolean>('reuseLastTab', false)
380379

381380
const target_browser_id = await this._select_browser()
382381
if (target_browser_id === undefined) {
@@ -451,7 +450,6 @@ export class WebSocketManager {
451450
options: web_configuration.options,
452451
client_id: this.client_id || 0, // 0 is a temporary fallback and should be removed few weeks from 28.03.25
453452
raw_instructions: params.raw_instructions,
454-
reuse_last_tab,
455453
inject_apply_response_button: params.inject_apply_response_button
456454
}
457455

@@ -484,7 +482,6 @@ export class WebSocketManager {
484482
const config = vscode.workspace.getConfiguration('codeWebChat')
485483
const gemini_user_number = config.get<number | null>('geminiUserNumber')
486484
const ai_studio_user_id = config.get<number | null>('aiStudioUserId')
487-
const reuse_last_tab = config.get<boolean>('reuseLastTab', false)
488485

489486
const chatbot =
490487
CHATBOTS[params.web_configuration.chatbot as keyof typeof CHATBOTS]
@@ -555,7 +552,6 @@ export class WebSocketManager {
555552
options: params.web_configuration.options,
556553
client_id: this.client_id || 0, // 0 is a temporary fallback and should be removed few weeks from 28.03.25
557554
raw_instructions: params.raw_instructions,
558-
reuse_last_tab,
559555
inject_apply_response_button: params.inject_apply_response_button
560556
}
561557

‎apps/editor/src/views/settings/backend/message-handlers/handle-get-reuse-last-tab.ts‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎apps/editor/src/views/settings/backend/message-handlers/handle-update-reuse-last-tab.ts‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎apps/editor/src/views/settings/backend/message-handlers/index.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ export * from './handle-open-ignore-patterns-settings'
3333
export * from './handle-open-allow-patterns-settings'
3434
export * from './handle-get-send-with-shift-enter'
3535
export * from './handle-update-send-with-shift-enter'
36-
export * from './handle-get-reuse-last-tab'
37-
export * from './handle-update-reuse-last-tab'
3836
export * from './handle-get-api-configurations'
3937
export * from './handle-get-auto-run-intelligent-update'
4038
export * from './handle-update-auto-run-intelligent-update'

‎apps/editor/src/views/settings/backend/settings-view-provider.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
handle_get_ai_studio_user_id,
1919
handle_get_model_providers,
2020
handle_get_send_with_shift_enter,
21-
handle_get_reuse_last_tab,
2221
handle_reorder_model_providers,
2322
handle_set_default_api_configuration,
2423
handle_select_default_api_configuration,
@@ -31,7 +30,6 @@ import {
3130
handle_update_gemini_user_id,
3231
handle_update_ai_studio_user_id,
3332
handle_update_send_with_shift_enter,
34-
handle_update_reuse_last_tab,
3533
handle_open_ignore_patterns_settings,
3634
handle_open_allow_patterns_settings,
3735
handle_get_auto_run_patch_repair as handle_get_auto_run_patch_repair,
@@ -236,10 +234,6 @@ export class SettingsViewProvider {
236234
await handle_get_send_with_shift_enter(this)
237235
} else if (message.command == 'UPDATE_SEND_WITH_SHIFT_ENTER') {
238236
await handle_update_send_with_shift_enter(message)
239-
} else if (message.command == 'GET_REUSE_LAST_TAB') {
240-
await handle_get_reuse_last_tab(this)
241-
} else if (message.command == 'UPDATE_REUSE_LAST_TAB') {
242-
await handle_update_reuse_last_tab(message)
243237
} else if (message.command == 'OPEN_EDITOR_SETTINGS') {
244238
await vscode.commands.executeCommand('workbench.action.openSettings')
245239
} else if (message.command == 'OPEN_IGNORE_PATTERNS_SETTINGS') {
@@ -308,7 +302,6 @@ export class SettingsViewProvider {
308302
void handle_get_gemini_user_id(this)
309303
void handle_get_ai_studio_user_id(this)
310304
void handle_get_send_with_shift_enter(this)
311-
void handle_get_reuse_last_tab(this)
312305
void handle_get_auto_run_patch_repair(this)
313306
void handle_get_templates(this)
314307
this._send_web_configurations()

‎apps/editor/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export type NavItem =
2828
| 'section:general:group:commit-messages'
2929
| 'section:web'
3030
| 'section:web:group:web-configurations'
31-
| 'section:web:group:chatbots-other'
3231
| 'section:api'
3332
| 'section:api:group:model-providers'
3433
| 'section:api:group:api-configurations'
@@ -67,10 +66,6 @@ const NAV_ITEMS_CONFIG: NavConfigItem[] = [
6766
id: 'section:web:group:web-configurations',
6867
label: 'chatbots.configurations.title'
6968
},
70-
{
71-
id: 'section:web:group:chatbots-other',
72-
label: 'chatbots.behavior.title'
73-
},
7469
{
7570
id: 'section:api',
7671
label: 'api.title'
@@ -112,7 +107,6 @@ type Props = {
112107
gemini_user_id: number | null
113108
ai_studio_user_id: number | null
114109
send_with_shift_enter: boolean
115-
reuse_last_tab: boolean
116110
clear_checks_in_workspace_behavior: 'ignore-open-editors' | 'uncheck-all'
117111
auto_run_patch_repair: boolean
118112
templates: Record<string, Template[]>
@@ -142,7 +136,6 @@ type Props = {
142136
on_gemini_user_id_change: (id: number | null) => void
143137
on_ai_studio_user_id_change: (id: number | null) => void
144138
on_send_with_shift_enter_change: (enabled: boolean) => void
145-
on_reuse_last_tab_change: (enabled: boolean) => void
146139
on_clear_checks_in_workspace_behavior_change: (
147140
value: 'ignore-open-editors' | 'uncheck-all'
148141
) => void
@@ -195,7 +188,6 @@ export const Home: React.FC<Props> = (props) => {
195188
'section:general:group:commit-messages': null,
196189
'section:web': null,
197190
'section:web:group:web-configurations': null,
198-
'section:web:group:chatbots-other': null,
199191
'section:api': null,
200192
'section:api:group:model-providers': null,
201193
'section:api:group:api-configurations': null,
@@ -241,12 +233,6 @@ export const Home: React.FC<Props> = (props) => {
241233
) {
242234
continue
243235
}
244-
if (
245-
item.id === 'section:web:group:chatbots-other' &&
246-
props.web_configurations.length === 0
247-
) {
248-
continue
249-
}
250236
if (
251237
[
252238
'section:api:group:api-defaults',
@@ -262,7 +248,6 @@ export const Home: React.FC<Props> = (props) => {
262248
return last_id
263249
}, [
264250
props.providers.length,
265-
props.web_configurations.length,
266251
props.api_configurations.length
267252
])
268253

@@ -339,13 +324,7 @@ export const Home: React.FC<Props> = (props) => {
339324
) {
340325
continue
341326
}
342-
if (
343-
item.id === 'section:web:group:chatbots-other' &&
344-
props.web_configurations.length === 0
345-
) {
346-
continue
347-
}
348-
if (
327+
if (
349328
[
350329
'section:api:group:api-defaults',
351330
'section:api:group:api-behavior',
@@ -379,7 +358,6 @@ export const Home: React.FC<Props> = (props) => {
379358
}
380359
}, [
381360
props.providers.length,
382-
props.web_configurations.length,
383361
props.api_configurations.length
384362
])
385363

@@ -461,12 +439,6 @@ export const Home: React.FC<Props> = (props) => {
461439
) {
462440
continue
463441
}
464-
if (
465-
item.id === 'section:web:group:chatbots-other' &&
466-
props.web_configurations.length === 0
467-
) {
468-
continue
469-
}
470442
if (
471443
[
472444
'section:api:group:api-defaults',
@@ -647,8 +619,6 @@ export const Home: React.FC<Props> = (props) => {
647619
on_toggle_pinned_web_configuration={
648620
props.on_toggle_pinned_web_configuration
649621
}
650-
reuse_last_tab={props.reuse_last_tab}
651-
on_reuse_last_tab_change={props.on_reuse_last_tab_change}
652622
gemini_user_id={props.gemini_user_id}
653623
ai_studio_user_id={props.ai_studio_user_id}
654624
on_gemini_user_id_change={props.on_gemini_user_id_change}

‎apps/editor/src/views/settings/frontend/Home/sections/WebSection.tsx‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Section as UiSection } from '@ui/components/editor/settings/Section'
33
import { Group as UiGroup } from '@ui/components/editor/settings/Group/Group'
44
import { Notice as UiNotice } from '@ui/components/editor/settings/Notice'
55
import { Input as UiInput } from '@ui/components/editor/common/Input'
6-
import { Toggler as UiToggler } from '@ui/components/editor/common/Toggler'
76
import { Item as UiItem } from '@ui/components/editor/settings/Item'
87
import { Button } from '@ui/components/editor/common/Button'
98
import { SortableList } from '@ui/components/editor/settings/SortableList'
@@ -26,8 +25,6 @@ type Props = {
2625
on_delete_web_configuration: (name: string) => void
2726
on_toggle_pinned_web_configuration: (config: WebConfiguration) => void
2827
set_section_ref: (id: NavItem, el: HTMLDivElement | null) => void
29-
reuse_last_tab: boolean
30-
on_reuse_last_tab_change: (enabled: boolean) => void
3128
gemini_user_id: number | null
3229
ai_studio_user_id: number | null
3330
on_gemini_user_id_change: (id: number | null) => void
@@ -308,26 +305,6 @@ export const WebSection = forwardRef<HTMLDivElement, Props>(
308305
)}
309306
</UiGroup>
310307
</div>
311-
{props.web_configurations.length > 0 && (
312-
<div
313-
ref={(el) =>
314-
props.set_section_ref('section:web:group:chatbots-other', el)
315-
}
316-
>
317-
<UiGroup title={t('chatbots.behavior.title')}>
318-
<UiItem
319-
title={t('chatbots.behavior.reuse-last-tab.title')}
320-
description={t('chatbots.behavior.reuse-last-tab.description')}
321-
slot_right={
322-
<UiToggler
323-
is_on={props.reuse_last_tab}
324-
on_toggle={props.on_reuse_last_tab_change}
325-
/>
326-
}
327-
/>
328-
</UiGroup>
329-
</div>
330-
)}
331308
</UiSection>
332309
)
333310
}

‎apps/editor/src/views/settings/frontend/Settings.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export const Settings = () => {
9797
settings_hook.gemini_user_id !== undefined &&
9898
settings_hook.ai_studio_user_id !== undefined &&
9999
settings_hook.send_with_shift_enter !== undefined &&
100-
settings_hook.reuse_last_tab !== undefined &&
101100
settings_hook.clear_checks_in_workspace_behavior !== undefined &&
102101
settings_hook.auto_run_patch_repair !== undefined &&
103102
settings_hook.is_modern_ui !== undefined &&
@@ -152,7 +151,6 @@ export const Settings = () => {
152151
gemini_user_id={settings_hook.gemini_user_id!}
153152
ai_studio_user_id={settings_hook.ai_studio_user_id!}
154153
send_with_shift_enter={settings_hook.send_with_shift_enter!}
155-
reuse_last_tab={settings_hook.reuse_last_tab!}
156154
clear_checks_in_workspace_behavior={
157155
settings_hook.clear_checks_in_workspace_behavior!
158156
}
@@ -201,7 +199,6 @@ export const Settings = () => {
201199
on_send_with_shift_enter_change={
202200
settings_hook.handle_send_with_shift_enter_change
203201
}
204-
on_reuse_last_tab_change={settings_hook.handle_reuse_last_tab_change}
205202
on_auto_run_patch_repair_change={
206203
settings_hook.handle_auto_run_patch_repair_change
207204
}

0 commit comments

Comments
 (0)