Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transparent overlay #103

Closed
wants to merge 40 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
eeaf83f
Added product (#285)
nang-dev Aug 27, 2024
91ea29c
set quality:stable (#267)
Himanshu-Singh-Chauhan Aug 27, 2024
b60edfe
update MacOS example in CONTRIBUTING.md file: Packaging step 3 - int…
Pockylee Aug 27, 2024
d53fdbb
PearAI main app welcome page gif fixed (#286)
Pockylee Aug 29, 2024
70abf1a
Fixed walk through (#288)
nang-dev Aug 30, 2024
a88583c
Added to readme (#295)
nang-dev Sep 3, 2024
b3eca81
add hacker theme to pearai (#300)
andrewjhopkins Sep 9, 2024
00d73de
Update README.md
Fryingpannn Sep 10, 2024
b5358dd
Set default theme to PearAI Dark/Light (#322)
andrewjhopkins Sep 14, 2024
86cb76b
Added auto-updating working client-side (#340)
nang-dev Sep 17, 2024
66fe97e
Updated wording (#341)
nang-dev Sep 17, 2024
b3652dc
Setup Environment with Space in Path (#335)
ashvinnihalani Sep 17, 2024
3e0030a
Added v1.1.0 (#344)
nang-dev Sep 18, 2024
a05830b
Bumped to v1.2.0
Sep 18, 2024
bfa5793
Update README.md
Fryingpannn Sep 18, 2024
f9aa0c3
patch-wsl (add vscode commit) (#348)
Himanshu-Singh-Chauhan Sep 19, 2024
b7c70af
Update README.md
Fryingpannn Sep 28, 2024
c6d1cde
If you are looking for commit history, read this please
Oct 3, 2024
f0cb6ea
Updated to v1.3.0
Oct 6, 2024
446c483
add pear version in about
Himanshu-Singh-Chauhan Sep 26, 2024
fe535a4
Update CONTRIBUTING.md
jpan8866 Oct 11, 2024
5e796de
Update CONTRIBUTING.md
jpan8866 Oct 11, 2024
efadcb7
Update CONTRIBUTING.md
jpan8866 Oct 11, 2024
8c8f27a
Git submodule commit update (#66)
Fryingpannn Oct 21, 2024
3731923
Bumped to v1.4.0
Oct 22, 2024
1239894
PearAI Overlay (#67)
Fryingpannn Oct 23, 2024
81b5cca
Bumped to v1.4.1
Oct 24, 2024
ae04061
Fix overlay popping up for half a second at startup (#77)
Fryingpannn Oct 25, 2024
1c057ad
Bumped versions (#80)
nang-dev Oct 29, 2024
94841c5
Handle overlay integration shortcuts (#84)
jpan8866 Oct 30, 2024
295847f
feat: new window watermark (#87)
Himanshu-Singh-Chauhan Nov 1, 2024
d831c05
Added darken and click outside overlay. todo for not closing
Nov 2, 2024
2140755
Added min for the auxbar (#94)
nang-dev Nov 2, 2024
8aa57ca
feat: overlay-lock (#92)
Himanshu-Singh-Chauhan Nov 3, 2024
81e7dde
Added remove release notes (#96)
nang-dev Nov 4, 2024
a46138c
remove unused vars (#97)
Himanshu-Singh-Chauhan Nov 4, 2024
d86f59a
Bumped to v1.4.4
Nov 5, 2024
4a51083
Default close sidebar for new window (#98)
jpan8866 Nov 5, 2024
5d555dc
Bumped to v1.4.5
Nov 6, 2024
b7ce481
transparent stuff
Himanshu-Singh-Chauhan Nov 6, 2024
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
Prev Previous commit
transparent stuff
Himanshu-Singh-Chauhan committed Nov 6, 2024
commit b7ce4812d313133cdfb1940756f6ff7bc45a0c71
86 changes: 20 additions & 66 deletions src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts
Original file line number Diff line number Diff line change
@@ -145,69 +145,23 @@ export class PearOverlayPart extends Part {
this.fullScreenOverlay.style.left = "0";
this.fullScreenOverlay.style.right = "0";
this.fullScreenOverlay.style.bottom = "0";
this.fullScreenOverlay.style.backgroundColor = "rgba(0, 0, 0, 0.2)";
// this.fullScreenOverlay.style.pointerEvents = "none"; // Ignore clicks on the full screen overlay
this.fullScreenOverlay!.style.backgroundColor = "rgba(0, 0, 0, 0.5)"; // Darken the overlay

// create the popup area overlay. this is just a target for webview to layout over
this.popupAreaOverlay = $("div.pearai-popup-area-overlay");
this.popupAreaOverlay.style.position = "absolute";
this.popupAreaOverlay.style.margin = "0";
this.popupAreaOverlay.style.top = "0";
this.popupAreaOverlay.style.left = "0";
this.popupAreaOverlay.style.right = "0";
this.popupAreaOverlay.style.bottom = "0";
this.element.appendChild(this.popupAreaOverlay);

// if both content and webview are ready, end loading state and open
if (this.popupAreaOverlay && this.webviewView) {
//this.webviewView?.webview.layoutWebviewOverElement(this.popupAreaOverlay);
// createContentArea is called within the workbench and layout when instantiating the overlay.
// If we don't close it here, it will open up by default when editor starts, or appear for half a second.
// If we remove this completely, it gets stuck in the loading stage, so we must close it.
this.close();
} else {
// hide stuff while we load
this.fullScreenOverlay!.style.display = "none";
}

return this.fullScreenOverlay!;
this.fullScreenOverlay.style.backgroundColor = "transparent";
this.close();
// Remove popup area overlay creation
return this.fullScreenOverlay;
}

override layout(
width: number,
height: number,
top: number,
left: number,
): void {
override layout(width: number, height: number, top: number, left: number): void {
super.layout(width, height, top, left);
if (this.fullScreenOverlay) {
this.fullScreenOverlay!.style.width = `${width}px`;
this.fullScreenOverlay!.style.height = `${height}px`;
}

// Calculate 80% of width and height
const overlayWidth = Math.floor(width * 0.8);
const overlayHeight = Math.floor(height * 0.8);

// Calculate position to center the overlay
const overlayLeft = Math.floor((width - overlayWidth) / 2);
const overlayTop = Math.floor((height - overlayHeight) / 2);

if (this.popupAreaOverlay) {
this.popupAreaOverlay.style.width = `${overlayWidth}px`;
this.popupAreaOverlay.style.height = `${overlayHeight}px`;
this.popupAreaOverlay.style.left = `${overlayLeft}px`;
this.popupAreaOverlay.style.top = `${overlayTop}px`;
this.popupAreaOverlay.style.backgroundColor =
"var(--vscode-editor-background)";
this.popupAreaOverlay.style.borderRadius = "12px";
if (this.fullScreenOverlay) {
this.fullScreenOverlay.style.width = `${width}px`;
this.fullScreenOverlay.style.height = `${height}px`;
}

// The webview can now be positioned anywhere within the full screen overlay
if (this.state === "open") {
this.webviewView!.webview.layoutWebviewOverElement(
this.popupAreaOverlay!,
);
this.webviewView!.webview.layoutWebviewOverElement(this.fullScreenOverlay!);
}
}

@@ -219,18 +173,18 @@ export class PearOverlayPart extends Part {
this.fullScreenOverlay!.style.zIndex = "95";

const container = this.webviewView!.webview.container;
container.style.display = "flex";
container.style.boxSizing = "border-box";
container.style.boxShadow = "0 0 20px 0 rgba(0, 0, 0, 0.5)";
container.style.borderRadius = "12px";
container.style.backgroundColor = "var(--vscode-editor-background)";
container.style.position = "absolute";
container.style.display = "block";
container.style.zIndex = "1000";
this.fullScreenOverlay?.addEventListener("click", () => {
// TODO: If we are in the tutorial, don't close
this.close();
});
container.style.backgroundColor = "transparent";

const iframe = container.querySelector('iframe');
if (iframe) {
iframe.style.backgroundColor = 'transparent';
iframe.style.background = 'none';
}

this.webviewView!.webview.layoutWebviewOverElement(this.popupAreaOverlay!);
this.webviewView!.webview.layoutWebviewOverElement(this.fullScreenOverlay!);
this.focus();
}