diff --git a/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx b/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx index 70219c0b..240ec032 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx @@ -40,7 +40,11 @@ export const _registerServices = (services_: ReactServicesType) => { const disposables: IDisposable[] = [] - if (wasCalled) console.error(`⚠️ Void _registerServices was called again! It should only be called once.`) + // don't register services twice + if (wasCalled) { + return + // console.error(`⚠️ Void _registerServices was called again! It should only be called once.`) + } wasCalled = true services = services_ diff --git a/src/vs/workbench/contrib/void/browser/sidebarActions.ts b/src/vs/workbench/contrib/void/browser/sidebarActions.ts index 3b544a83..5f9a9356 100644 --- a/src/vs/workbench/contrib/void/browser/sidebarActions.ts +++ b/src/vs/workbench/contrib/void/browser/sidebarActions.ts @@ -18,7 +18,7 @@ import { IEditorService } from '../../../services/editor/common/editorService.js import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js'; import { IRange } from '../../../../editor/common/core/range.js'; import { ITextModel } from '../../../../editor/common/model.js'; -import { VOID_VIEW_ID } from './sidebarViewPane.js'; +import { VOID_VIEW_ID } from './sidebarPane.js'; import { IMetricsService } from '../../../../platform/void/common/metricsService.js'; import { ISidebarStateService } from './sidebarStateService.js'; diff --git a/src/vs/workbench/contrib/void/browser/sidebarViewPane.ts b/src/vs/workbench/contrib/void/browser/sidebarPane.ts similarity index 88% rename from src/vs/workbench/contrib/void/browser/sidebarViewPane.ts rename to src/vs/workbench/contrib/void/browser/sidebarPane.ts index 87d0872c..974b0e11 100644 --- a/src/vs/workbench/contrib/void/browser/sidebarViewPane.ts +++ b/src/vs/workbench/contrib/void/browser/sidebarPane.ts @@ -38,6 +38,7 @@ import { mountSidebar } from './react/out/sidebar-tsx/index.js'; import { getReactServices } from './helpers/reactServicesHelper.js'; import { Codicon } from '../../../../base/common/codicons.js'; +import { Orientation } from '../../../../base/browser/ui/sash/sash.js'; // import { Orientation } from '../../../../base/browser/ui/sash/sash.js'; // import { Codicon } from '../../../../base/common/codicons.js'; // import { Codicon } from '../../../../base/common/codicons.js'; @@ -47,7 +48,7 @@ import { Codicon } from '../../../../base/common/codicons.js'; // ---------- Define viewpane ---------- -class VoidSidebarViewPane extends ViewPane { +class SidebarViewPane extends ViewPane { constructor( options: IViewPaneOptions, @@ -83,6 +84,14 @@ class VoidSidebarViewPane extends ViewPane { }); } + override layoutBody(height: number, width: number): void { + super.layoutBody(height, width) + this.element.style.height = `${height}px` + this.element.style.width = `${width}px` + + + } + } @@ -100,15 +109,17 @@ export const VOID_VIEW_ID = VOID_VIEW_CONTAINER_ID const viewContainerRegistry = Registry.as(ViewContainerExtensions.ViewContainersRegistry); const container = viewContainerRegistry.registerViewContainer({ id: VOID_VIEW_CONTAINER_ID, - title: nls.localize2('voidContainer', 'Void'), // this is used to say "Void" (Ctrl + L) - ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [VOID_VIEW_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]), + title: nls.localize2('voidContainer', 'Void Chat'), // this is used to say "Void" (Ctrl + L) + ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [VOID_VIEW_CONTAINER_ID, { + mergeViewWithContainerWhenSingleView: true, + orientation: Orientation.HORIZONTAL, + }]), hideIfEmpty: false, order: 1, + rejectAddedViews: true, icon: Codicon.symbolMethod, - alwaysUseContainerInfo: true, - // alwaysUseContainerInfo: true, - // icon: , + }, ViewContainerLocation.AuxiliaryBar, { doNotRegisterOpenCommand: true, isDefault: true }); @@ -120,11 +131,12 @@ viewsRegistry.registerViews([{ id: VOID_VIEW_ID, hideByDefault: false, // start open // containerIcon: voidViewIcon, - name: nls.localize2('voidChat', 'Chat'), // this says ... : CHAT - ctorDescriptor: new SyncDescriptor(VoidSidebarViewPane), + name: nls.localize2('voidChat', ''), // this says ... : CHAT + ctorDescriptor: new SyncDescriptor(SidebarViewPane), canToggleVisibility: false, canMoveView: false, // can't move this out of its container - + weight: 80, + order: 1, // singleViewPaneContainerTitle: 'hi', // openCommandActionDescriptor: { diff --git a/src/vs/workbench/contrib/void/browser/sidebarStateService.ts b/src/vs/workbench/contrib/void/browser/sidebarStateService.ts index 0cab1180..683a3ed4 100644 --- a/src/vs/workbench/contrib/void/browser/sidebarStateService.ts +++ b/src/vs/workbench/contrib/void/browser/sidebarStateService.ts @@ -3,7 +3,7 @@ import { Disposable } from '../../../../base/common/lifecycle.js'; import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; import { IViewsService } from '../../../services/views/common/viewsService.js'; -import { VOID_VIEW_CONTAINER_ID, VOID_VIEW_ID } from './sidebarViewPane.js'; +import { VOID_VIEW_CONTAINER_ID, VOID_VIEW_ID } from './sidebarPane.js'; // service that manages sidebar's state diff --git a/src/vs/workbench/contrib/void/browser/void.contribution.ts b/src/vs/workbench/contrib/void/browser/void.contribution.ts index b7d3f8be..a67594a7 100644 --- a/src/vs/workbench/contrib/void/browser/void.contribution.ts +++ b/src/vs/workbench/contrib/void/browser/void.contribution.ts @@ -9,7 +9,7 @@ import './inlineDiffsService.js' // register Sidebar pane, state, actions (keybinds, menus) import './sidebarActions.js' -import './sidebarViewPane.js' +import './sidebarPane.js' import './sidebarStateService.js' // register Thread History