Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/vs/workbench/browser/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
private editorPartView!: ISerializableView;
private statusBarPartView!: ISerializableView;
private pearOverlayPartView!: ISerializableView;
private agentOverlayPartView!: ISerializableView;

private environmentService!: IBrowserWorkbenchEnvironmentService;
private extensionService!: IExtensionService;
Expand Down Expand Up @@ -1489,6 +1490,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
const sideBar = this.getPart(Parts.SIDEBAR_PART);
const statusBar = this.getPart(Parts.STATUSBAR_PART);
const pearOverlayPart = this.getPart(Parts.PEAROVERLAY_PART);
const agentOverlayPart = this.getPart(Parts.AGENTOVERLAY_PART);

// View references for all parts
this.titleBarPartView = titleBar;
Expand All @@ -1500,6 +1502,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
this.auxiliaryBarPartView = auxiliaryBarPart;
this.statusBarPartView = statusBar;
this.pearOverlayPartView = pearOverlayPart;
this.agentOverlayPartView = agentOverlayPart;

// Create a new container for PearOverlayPart
const pearOverlayPartContainer = document.createElement("div");
Expand All @@ -1516,6 +1519,21 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
this.mainContainer.appendChild(pearOverlayPartContainer);
pearOverlayPart.create(pearOverlayPartContainer);

// Create a new container for AgentOverlayPart
const agentOverlayPartContainer = document.createElement("div");
agentOverlayPartContainer.style.position = "absolute";
agentOverlayPartContainer.style.top = "0";
agentOverlayPartContainer.style.left = "0";
agentOverlayPartContainer.style.right = "0";
agentOverlayPartContainer.style.bottom = "0";
agentOverlayPartContainer.style.zIndex = "-10";
agentOverlayPartContainer.style.display = "absolute";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: The display property of agentOverlayPartContainer is set to absolute, which is not a valid CSS display value. Consider using block (or another appropriate value) instead.

Suggested change
agentOverlayPartContainer.style.display = "absolute";
agentOverlayPartContainer.style.display = "block";

agentOverlayPartContainer.classList.add("pearoverlay-part-container");
agentOverlayPartContainer.style.backgroundColor = 'transparent';

this.mainContainer.appendChild(agentOverlayPartContainer);
agentOverlayPart.create(agentOverlayPartContainer);

const viewMap = {
[Parts.ACTIVITYBAR_PART]: this.activityBarPartView,
[Parts.BANNER_PART]: this.bannerPartView,
Expand All @@ -1526,6 +1544,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
[Parts.STATUSBAR_PART]: this.statusBarPartView,
[Parts.AUXILIARYBAR_PART]: this.auxiliaryBarPartView,
[Parts.PEAROVERLAY_PART]: this.pearOverlayPartView,
[Parts.AGENTOVERLAY_PART]: this.agentOverlayPartView
};

const fromJSON = ({ type }: { type: Parts }) => viewMap[type];
Expand Down
147 changes: 147 additions & 0 deletions src/vs/workbench/browser/parts/overlayAgent/agentOverlayActions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
// import { registerAction2, Action2 } from "../../../../platform/actions/common/actions.js";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All code is commented out. Remove or clean up these commented-out action definitions if they are not needed.

// import { ServicesAccessor } from "../../../../platform/instantiation/common/instantiation.js";
// import { IAgentOverlayService } from "./agentOverlayService.js";
// import { KeyCode, KeyMod } from "../../../../base/common/keyCodes.js";
// import { IStorageService } from '../../../../platform/storage/common/storage.js';
// import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js';
// import { ICommandService } from '../../../../platform/commands/common/commands.js';


// const PEARAI_FIRST_LAUNCH_KEY = "testkey"

// export class CloseAgentOverlayAction extends Action2 {
// static readonly ID = "workbench.action.closeAgentOverlay";

// constructor() {
// super({
// id: CloseAgentOverlayAction.ID,
// title: { value: "Close Agent Popup", original: "Close Agent Popup" },
// f1: true,
// keybinding: {
// weight: 200,
// primary: KeyCode.Escape,
// },
// });
// }

// run(accessor: ServicesAccessor): void {
// const pearaiOverlayService = accessor.get(IPearOverlayService);
// pearaiOverlayService.hide();
// }
// }

// export class TogglePearOverlayAction extends Action2 {
// static readonly ID = "workbench.action.togglePearAI";

// constructor() {
// super({
// id: TogglePearOverlayAction.ID,
// title: { value: "Toggle PearAI Popup", original: "Toggle PearAI Popup" },
// f1: true,
// keybinding: {
// weight: 200,
// primary: KeyMod.CtrlCmd | KeyCode.KeyE,
// },
// });
// }

// run(accessor: ServicesAccessor): void {
// const pearaiOverlayService = accessor.get(IPearOverlayService);
// pearaiOverlayService.toggle();
// }
// }

// export class MarkPearAIFirstLaunchCompleteAction extends Action2 {
// static readonly ID = "workbench.action.markPearAIFirstLaunchComplete";

// constructor() {
// super({
// id: MarkPearAIFirstLaunchCompleteAction.ID,
// title: { value: "Mark PearAI First Launch Key Complete", original: "Mark PearAI First Launch Key Complete" },
// f1: true,
// });
// }

// run(accessor: ServicesAccessor): void {
// const storageService = accessor.get(IStorageService);
// storageService.store(PEARAI_FIRST_LAUNCH_KEY, true, 0, 0);
// // const notificationService = accessor.get(INotificationService);
// // const commandService = accessor.get(ICommandService); // Get command service early
// // notificationService.notify({
// // severity: Severity.Info,
// // message: 'Successfully marked PearAI first launch Key complete',
// // actions: {
// // primary: [{
// // id: 'reloadWindow',
// // label: 'Reload Window',
// // tooltip: 'Reload Window',
// // class: '',
// // enabled: true,
// // run: () => {
// // commandService.executeCommand('workbench.action.reloadWindow');
// // }
// // }]
// // }
// // });
// }
// }

// export class ResetPearAIFirstLaunchKeyAction extends Action2 {
// static readonly ID = "workbench.action.resetPearAIFirstLaunchKey";

// constructor() {
// super({
// id: ResetPearAIFirstLaunchKeyAction.ID,
// title: { value: "Reset PearAI First Launch Key", original: "Reset PearAI First Launch Key" },
// f1: true,
// });
// }

// run(accessor: ServicesAccessor): void {
// const storageService = accessor.get(IStorageService);
// const notificationService = accessor.get(INotificationService);
// const commandService = accessor.get(ICommandService); // Get command service early

// storageService.store(PEARAI_FIRST_LAUNCH_KEY, false, 0, 0);
// notificationService.notify({
// severity: Severity.Info,
// message: 'Successfully reset PearAI first launch Key',
// actions: {
// primary: [{
// id: 'reloadWindow',
// label: 'Reload Window',
// tooltip: 'Reload Window',
// class: '',
// enabled: true,
// run: () => {
// commandService.executeCommand('workbench.action.reloadWindow');
// }
// }]
// }
// });
// }
// }

// export class IsPearAIFirstLaunchAction extends Action2 {
// static readonly ID = "workbench.action.isPearAIFirstLaunch";

// constructor() {
// super({
// id: IsPearAIFirstLaunchAction.ID,
// title: { value: "Is PearAI First Launch", original: "Is PearAI First Launch" },
// f1: true,
// });
// }

// run(accessor: ServicesAccessor): boolean | undefined {
// const storageService = accessor.get(IStorageService);
// return !storageService.getBoolean(PEARAI_FIRST_LAUNCH_KEY, 0);
// }
// }

// // registerAction2(TogglePearOverlayAction);
// // registerAction2(CloseAgentOverlayAction);

// // registerAction2(MarkPearAIFirstLaunchCompleteAction);
// // registerAction2(ResetPearAIFirstLaunchKeyAction);
// // registerAction2(IsPearAIFirstLaunchAction);
Loading
Loading