|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
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'; |
9 | 6 | 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'; |
12 | 8 | import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
|
13 | 9 | import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
14 | 10 | import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
|
@@ -37,47 +33,8 @@ interface IViewPaneState extends IChatViewState {
|
37 | 33 | sessionId?: string;
|
38 | 34 | }
|
39 | 35 |
|
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 |
| - |
77 | 36 | export const CHAT_SIDEBAR_PANEL_ID = 'workbench.panel.aideAgentSidebar';
|
78 | 37 | export class ChatViewPane extends ViewPane {
|
79 |
| - private modeSwitcher!: ModeSwitcher; |
80 |
| - |
81 | 38 | private _widget!: ChatWidget;
|
82 | 39 | get widget(): ChatWidget { return this._widget; }
|
83 | 40 |
|
@@ -181,13 +138,6 @@ export class ChatViewPane extends ViewPane {
|
181 | 138 | try {
|
182 | 139 | super.renderBody(parent);
|
183 | 140 |
|
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 |
| - |
191 | 141 | const scopedInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
|
192 | 142 | const locationBasedColors = this.getLocationBasedColors();
|
193 | 143 | this._widget = this._register(scopedInstantiationService.createInstance(
|
|
0 commit comments