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

highlight cmd i onboarding #105

Merged
merged 55 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6348cb7
WIP: Walkthrough changes (#236)
nang-dev Aug 7, 2024
d2492e7
enable editorInsets for inline chat (#253)
Himanshu-Singh-Chauhan Aug 10, 2024
93afa4c
Fix .gitmodules
nang-dev Aug 13, 2024
32a2993
Update code.sh
nang-dev Aug 16, 2024
d6c4b40
update submodule to latest tip (#260)
Himanshu-Singh-Chauhan Aug 16, 2024
23dd39e
fix: #262 prioritize pearai commands (#264)
jpan8866 Aug 17, 2024
214a63d
Fixed code version
nang-dev Aug 18, 2024
12520a3
feat: docs and newchat shortcut on titlebar (#266)
Himanshu-Singh-Chauhan Aug 22, 2024
b4c9fc6
Update README.md (#276)
Fryingpannn Aug 25, 2024
0a99f95
Shortcut change to resize chat on the app side (#279)
MaxFSP Aug 27, 2024
43c1af7
update icon and watermark (#278)
Himanshu-Singh-Chauhan Aug 27, 2024
d6e05c0
Added product (#285)
nang-dev Aug 27, 2024
2497604
set quality:stable (#267)
Himanshu-Singh-Chauhan Aug 27, 2024
2215208
update MacOS example in CONTRIBUTING.md file: Packaging step 3 - int…
Pockylee Aug 27, 2024
4e9c06e
PearAI main app welcome page gif fixed (#286)
Pockylee Aug 29, 2024
be16ab4
Fixed walk through (#288)
nang-dev Aug 30, 2024
5c8a590
Added to readme (#295)
nang-dev Sep 3, 2024
f43562a
add hacker theme to pearai (#300)
andrewjhopkins Sep 9, 2024
6bfcb4d
Update README.md
Fryingpannn Sep 10, 2024
5ada7f7
Set default theme to PearAI Dark/Light (#322)
andrewjhopkins Sep 14, 2024
0dfd108
Added auto-updating working client-side (#340)
nang-dev Sep 17, 2024
980c32b
Updated wording (#341)
nang-dev Sep 17, 2024
b3ec777
Setup Environment with Space in Path (#335)
ashvinnihalani Sep 17, 2024
803cdc7
Added v1.1.0 (#344)
nang-dev Sep 18, 2024
69c3274
Bumped to v1.2.0
Sep 18, 2024
99bda92
Update README.md
Fryingpannn Sep 18, 2024
b6eff02
patch-wsl (add vscode commit) (#348)
Himanshu-Singh-Chauhan Sep 19, 2024
11ce7b2
Update README.md
Fryingpannn Sep 28, 2024
1fec74d
If you are looking for commit history, read this please
Oct 3, 2024
1e2cbc5
Updated to v1.3.0
Oct 6, 2024
ae1fc1e
add pear version in about
Himanshu-Singh-Chauhan Sep 26, 2024
90dbd86
Merge pull request #52 from Himanshu-Singh-Chauhan/him/version-about2
Fryingpannn Oct 9, 2024
2b2bebf
Update CONTRIBUTING.md
jpan8866 Oct 11, 2024
df72620
Update CONTRIBUTING.md
jpan8866 Oct 11, 2024
31f688f
Update CONTRIBUTING.md
jpan8866 Oct 11, 2024
00c1410
Git submodule commit update (#66)
Fryingpannn Oct 21, 2024
6644ab2
Bumped to v1.4.0
Oct 22, 2024
69b1b03
PearAI Overlay (#67)
Fryingpannn Oct 23, 2024
660167c
Bumped to v1.4.1
Oct 24, 2024
d4808c5
Fix overlay popping up for half a second at startup (#77)
Fryingpannn Oct 25, 2024
8a22731
Bumped versions (#80)
nang-dev Oct 29, 2024
6f49477
Handle overlay integration shortcuts (#84)
jpan8866 Oct 30, 2024
56f4fff
feat: new window watermark (#87)
Himanshu-Singh-Chauhan Nov 1, 2024
5b25b6c
Added darken and click outside overlay. todo for not closing
Nov 2, 2024
6f082d5
Added min for the auxbar (#94)
nang-dev Nov 2, 2024
29ee3bf
feat: overlay-lock (#92)
Himanshu-Singh-Chauhan Nov 3, 2024
b91b021
Added remove release notes (#96)
nang-dev Nov 4, 2024
8b746b1
remove unused vars (#97)
Himanshu-Singh-Chauhan Nov 4, 2024
2f2d7aa
Bumped to v1.4.4
Nov 5, 2024
82623b2
Default close sidebar for new window (#98)
jpan8866 Nov 5, 2024
edd006e
Add highlight of quickinput during cmd+i step
jpan8866 Nov 7, 2024
41c59f7
clean up
jpan8866 Nov 7, 2024
34e9e8e
Merge branch 'main' into panj/highlight-cmd-i-onboarding
jpan8866 Nov 7, 2024
e9aa39b
package.json
jpan8866 Nov 7, 2024
2d8ec78
remove transition
jpan8866 Nov 7, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { registerSingleton, InstantiationType } from 'vs/platform/instantiation/common/extensions';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';

export const IShadowOverlayService = createDecorator<IShadowOverlayService>('shadowOverlayService');

export interface IShadowOverlayService extends IDisposable {
readonly _serviceBrand: undefined;

highlight(elements: string[]): void;
restoreStyles(elements: string[]): void;
}


export class ShadowOverlayService extends Disposable implements IShadowOverlayService {
declare readonly _serviceBrand: undefined;
private highlightedElements: Map<string, {
position: string;
zIndex: string;
isolation: string;
pointerEvents: string;
backgroundColor: string;
boxShadow: string;
}> = new Map();

constructor(
) {
super();
this.registerCommands();
}

private registerCommands(): void {
CommandsRegistry.registerCommand('pearai.highlightElements', (accessor, ...args) => {

const selectors = args[0] as string[]; // array of CSS selectors
this.highlight(selectors);
});

CommandsRegistry.registerCommand('pearai.removeHighlight', (accessor, ...args) => {
const selectors = args[0] as string[]; // array of CSS selectors
// Convert selectors to elements
this.restoreStyles(selectors);
});
}

restoreStyles(selectors: string[]): void {
selectors.forEach(selector => {
const originalStyles = this.highlightedElements.get(selector);

const element = document.querySelector(selector) as HTMLElement

if (originalStyles) {
element.style.position = originalStyles.position;
element.style.zIndex = originalStyles.zIndex;
element.style.isolation = originalStyles.isolation;
element.style.pointerEvents = originalStyles.pointerEvents;
element.style.backgroundColor = originalStyles.backgroundColor;
element.style.boxShadow = originalStyles.boxShadow;

// Remove this element from the tracked elements
this.highlightedElements.delete(selector);
}
});
}

highlight(selectors: string[]): void {
selectors.forEach(selector => {
if (selector) {
const element = document.querySelector(selector) as HTMLElement

// save original styles
if (!this.highlightedElements.has(selector)) {
this.highlightedElements.set(selector, {
position: element.style.position,
zIndex: element.style.zIndex,
isolation: element.style.isolation,
pointerEvents: element.style.pointerEvents,
backgroundColor: element.style.backgroundColor,
boxShadow: element.style.boxShadow,
});
}
element.style.position = 'absolute';
element.style.zIndex = '3000';
element.style.isolation = 'isolate';
element.style.pointerEvents = 'auto';
element.style.backgroundColor = 'transparent';
element.style.boxShadow = '0 0 0 9999px rgba(0, 0, 0, 0.6)';
}
});
}
}

registerSingleton(IShadowOverlayService, ShadowOverlayService, InstantiationType.Eager,);
6 changes: 6 additions & 0 deletions src/vs/workbench/browser/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { setProgressAcccessibilitySignalScheduler } from 'vs/base/browser/ui/pro
import { AccessibleViewRegistry } from 'vs/platform/accessibility/browser/accessibleViewRegistry';
import { NotificationAccessibleView } from 'vs/workbench/browser/parts/notifications/notificationAccessibleView';
import { IPearOverlayService } from 'vs/workbench/browser/parts/overlay/pearOverlayService';
import { IShadowOverlayService } from 'vs/workbench/browser/parts/overlay/onboardingShadow/shadowOverlayService';

export interface IWorkbenchOptions {

Expand Down Expand Up @@ -380,6 +381,11 @@ export class Workbench extends Layout {
});
}

// instantiate highlighting
instantiationService.invokeFunction(accessor => {
accessor.get(IShadowOverlayService);
});

mark(`code/willCreatePart/${id}`);
this.getPart(id).create(partContainer, options);
mark(`code/didCreatePart/${id}`);
Expand Down
Loading