Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c4bd5e3

Browse files
committed
Revert mode-switcher changes
1 parent 987ba66 commit c4bd5e3

File tree

3 files changed

+4
-74
lines changed

3 files changed

+4
-74
lines changed

extensions/codestory/src/completions/providers/chatprovider.ts

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5+
6+
/*
57
import * as vscode from 'vscode';
68
import * as uuid from 'uuid';
79
@@ -574,3 +576,4 @@ class DocumentManager {
574576
return index + 2;
575577
}
576578
}
579+
*/

src/vs/workbench/contrib/aideAgent/browser/aideAgentViewPane.ts

+1-51
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { $, append } from '../../../../base/browser/dom.js';
7-
import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js';
8-
import { Action } from '../../../../base/common/actions.js';
96
import { CancellationToken } from '../../../../base/common/cancellation.js';
10-
import { Emitter, Event } from '../../../../base/common/event.js';
11-
import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';
7+
import { DisposableStore } from '../../../../base/common/lifecycle.js';
128
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
139
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
1410
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
@@ -37,47 +33,8 @@ interface IViewPaneState extends IChatViewState {
3733
sessionId?: string;
3834
}
3935

40-
class ModeSwitcher extends Disposable {
41-
private _onChange = this._register(new Emitter<{ id: string | null; focus: boolean }>());
42-
get onChange(): Event<{ id: string | null; focus: boolean }> { return this._onChange.event; }
43-
44-
private _currentId: string | null = null;
45-
get currentId(): string | null { return this._currentId; }
46-
47-
private actions: Action[];
48-
private actionbar: ActionBar;
49-
50-
constructor(container: HTMLElement) {
51-
super();
52-
const element = append(container, $('.mode-switcher'));
53-
this.actions = [];
54-
this.actionbar = this._register(new ActionBar(element));
55-
}
56-
57-
push(id: string, label: string, tooltip: string): void {
58-
const action = new Action(id, label, undefined, true, () => this.update(id, true));
59-
60-
action.tooltip = tooltip;
61-
62-
this.actions.push(action);
63-
this.actionbar.push(action);
64-
65-
if (this.actions.length === 1) {
66-
this.update(id);
67-
}
68-
}
69-
70-
private update(id: string, focus?: boolean): void {
71-
this._currentId = id;
72-
this._onChange.fire({ id, focus: !!focus });
73-
this.actions.forEach(a => a.checked = a.id === id);
74-
}
75-
}
76-
7736
export const CHAT_SIDEBAR_PANEL_ID = 'workbench.panel.aideAgentSidebar';
7837
export class ChatViewPane extends ViewPane {
79-
private modeSwitcher!: ModeSwitcher;
80-
8138
private _widget!: ChatWidget;
8239
get widget(): ChatWidget { return this._widget; }
8340

@@ -181,13 +138,6 @@ export class ChatViewPane extends ViewPane {
181138
try {
182139
super.renderBody(parent);
183140

184-
this.modeSwitcher = this._register(new ModeSwitcher(parent));
185-
this.modeSwitcher.push('edit', 'Edit', 'Edit code using the agent');
186-
this.modeSwitcher.push('chat', 'Chat', 'Chat with the agent');
187-
this.modeSwitcher.onChange(e => {
188-
console.log('modeSwitcher.onChange', e);
189-
});
190-
191141
const scopedInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
192142
const locationBasedColors = this.getLocationBasedColors();
193143
this._widget = this._register(scopedInstantiationService.createInstance(

src/vs/workbench/contrib/aideAgent/browser/media/aideAgent.css

-23
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,6 @@
1212
position: relative;
1313
}
1414

15-
#workbench\.panel\.aideAgentSidebar .pane-body > .mode-switcher {
16-
position: absolute;
17-
top: 12px;
18-
right: 16px;
19-
z-index: 1;
20-
}
21-
22-
#workbench\.panel\.aideAgentSidebar .pane-body > .mode-switcher > .monaco-action-bar > .actions-container {
23-
gap: 4px;
24-
}
25-
26-
#workbench\.panel\.aideAgentSidebar .pane-body > .mode-switcher > .monaco-action-bar > .actions-container > .action-item > .action-label {
27-
font-size: 11px;
28-
border-radius: 0;
29-
color: var(--vscode-panelTitle-inactiveForeground);
30-
text-transform: uppercase;
31-
}
32-
33-
#workbench\.panel\.aideAgentSidebar .pane-body > .mode-switcher > .monaco-action-bar > .actions-container > .action-item > .action-label.checked {
34-
border-bottom: 1px solid var(--vscode-panelTitle-activeBorder);
35-
color: var(--vscode-panelTitle-activeForeground);
36-
}
37-
3815
.interactive-list > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row > .monaco-tl-row > .monaco-tl-twistie {
3916
/* Hide twisties from chat tree rows, but not from nested trees within a chat response */
4017
display: none !important;

0 commit comments

Comments
 (0)