Skip to content

Conversation

Himanshu-Singh-Chauhan
Copy link
Member

@Himanshu-Singh-Chauhan Himanshu-Singh-Chauhan commented Mar 15, 2025

Important

Add AgentOverlayPart and AgentOverlayService to manage a new overlay in the workbench layout.

  • Behavior:
    • Adds AgentOverlayPart to layout.ts and workbench.ts for managing a new overlay in the workbench.
    • Initializes AgentOverlayPart with visibility and state management, including first launch behavior.
    • Registers AgentOverlayService to manage overlay actions like show, hide, toggle, and lock.
  • Service:
    • Introduces IAgentOverlayService and AgentOverlayService in agentOverlayService.ts for overlay management.
    • Registers commands for overlay actions in AgentOverlayService.
  • UI Components:
    • Creates agentOverlayPart.ts to define the overlay's layout and behavior.
    • Adds HTML containers for the overlay in layout.ts and workbench.ts.
  • Misc:
    • Adds AGENTOVERLAY_PART to Parts enum in layoutService.ts.
    • Includes placeholder actions in agentOverlayActions.ts (commented out).

This description was created by Ellipsis for 01c1647. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 01c1647 in 3 minutes and 4 seconds

More details
  • Looked at 900 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 13 drafted comments based on config settings.
1. src/vs/workbench/browser/parts/overlayAgent/agentOverlayPart.ts:3
  • Draft comment:
    Update or remove outdated comments referencing 'pearai' and design issues; rename CSS classes and variables to match the new agent overlay naming for clarity and consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50%
    The comment has two parts: 1) Renaming pearai identifiers which seems reasonable since this is a new file for agent overlay, 2) Removing design comments. The renaming suggestion is actionable and clear. The design comments actually seem current and relevant - they're discussing issues with this exact overlay implementation. They shouldn't be removed.
    The comment assumes the design comments are outdated without evidence. It also bundles two separate concerns (renaming and comment removal) into one comment.
    While the renaming suggestion has merit, I should not recommend removing seemingly relevant design comments. The comment would be better focused just on the naming consistency issue.
    The comment should be rejected as written since it incorrectly suggests removing relevant design comments. A new focused comment about renaming pearai identifiers could be valuable.
2. src/vs/workbench/browser/workbench.ts:357
  • Draft comment:
    Agent overlay service initialization is correctly invoked. Verify that similar initialization patterns are applied consistently.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. src/vs/workbench/services/layout/browser/layoutService.ts:31
  • Draft comment:
    Addition of AGENTOVERLAY_PART to the Parts enum appears correct. No further action needed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. src/vs/workbench/browser/parts/overlayAgent/agentOverlayActions.ts:1
  • Draft comment:
    Remove or clarify unused commented‐out action code. If these actions are deprecated, delete them or add a TODO comment.
  • Reason this comment was not posted:
    Marked as duplicate.
5. src/vs/workbench/browser/parts/overlayAgent/agentOverlayPart.ts:353
  • Draft comment:
    Replace 'PearAI' in log messages with a name consistent with Agent Overlay to avoid confusion.
  • Reason this comment was not posted:
    Marked as duplicate.
6. src/vs/workbench/browser/parts/overlayAgent/agentOverlayPart.ts:309
  • Draft comment:
    Avoid attaching a click event listener on fullScreenOverlay each time open() is called. Consider registering the listener once during initialization to prevent multiple listeners accumulating.
  • Reason this comment was not posted:
    Marked as duplicate.
7. src/vs/workbench/browser/parts/overlayAgent/agentOverlayService.ts:25
  • Draft comment:
    Update documentation and command identifiers to refer to 'Agent Overlay' rather than 'PearAI'. The current docs and command IDs (e.g. pearai.showAgentOverlay) are inconsistent with the new naming.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is purely informative, suggesting an update to documentation and command identifiers to reflect a naming change. It doesn't provide a specific code suggestion or ask for a test to be written. It doesn't align with the rules for good comments.
8. src/vs/workbench/browser/layout.ts:1524
  • Draft comment:
    Typo: The agent overlay container is assigned the class 'pearoverlay-part-container'. This appears to be a copy-paste error; it should likely use a class name such as 'agentoverlay-part-container' to avoid confusion.
  • Reason this comment was not posted:
    Marked as duplicate.
9. src/vs/workbench/browser/parts/overlayAgent/agentOverlayPart.ts:4
  • Draft comment:
    Typographical error: Consider changing "its not maintainable and iterable." to "it's not maintainable and iterable." for improved clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50%
    This is a very minor grammatical fix in a comment. The comment block appears to be an informal TODO list or note to another developer (addressed to "@Himanshu"). The grammatical error doesn't impact code functionality or readability. Comments are typically more informal and don't need perfect grammar. This seems like unnecessary nitpicking.
    The grammatical error could be seen as unprofessional, and fixing it would improve code quality in a small way. Some teams do care about comment quality.
    While professional quality is important, this comment block is clearly an informal TODO/note between developers. The grammatical fix is too minor to warrant a PR comment, especially given the informal nature of the block.
    Delete this comment. Fixing grammar in an informal TODO comment is too minor and not worth a PR comment.
10. src/vs/workbench/browser/parts/overlayAgent/agentOverlayPart.ts:5
  • Draft comment:
    Typographical error: Consider correcting "Simplyfy this." to "Simplify this.".
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    While the spelling error exists, this is in what appears to be an informal TODO comment block. These comments seem to be internal notes rather than public documentation. Correcting spelling in informal internal notes/TODOs doesn't provide meaningful value. The comment also doesn't affect any actual code functionality.
    Perhaps maintaining consistent professional spelling even in internal comments helps with code quality and readability? Maybe this sets a good standard for the codebase?
    While professional standards are important, nitpicking spelling in informal TODO comments creates noise and distracts from more substantive code review feedback. The meaning is still clear despite the typo.
    This comment should be deleted as it provides minimal value by correcting spelling in an informal internal comment block.
11. src/vs/workbench/browser/workbench.ts:49
  • Draft comment:
    Typo: 'setProgressAcccessibilitySignalScheduler' appears to have an extra 'c'. Consider renaming it to 'setProgressAccessibilitySignalScheduler' for clarity.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
12. src/vs/workbench/browser/workbench.ts:244
  • Draft comment:
    Typo: The comments use 'loosing' where 'losing' is intended. Please change phrases like 'the chance of loosing any state' and 'window loosing focus' to use 'losing'.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
13. src/vs/workbench/services/layout/browser/layoutService.ts:268
  • Draft comment:
    Typo in comment: 'alignement' should be spelled 'alignment'.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_1fWH1BDpf09zdiuF


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -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.

this.loadingOverlay.style.display = "flex";
}

this.fullScreenOverlay?.addEventListener("click", () => {
Copy link

Choose a reason for hiding this comment

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

In the open() method, an event listener is added on each call. Consider ensuring that the click listener is added only once to prevent multiple handler instances.

},
extension: extensionDescription,
});

Copy link

Choose a reason for hiding this comment

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

Consider refactoring redundant style assignments and use CSS classes instead of inline styles to improve maintainability.


// Focus the active editor
this._editorGroupsService.activeGroup.focus();
}, 20); // 20ms matches the animation duration
Copy link

Choose a reason for hiding this comment

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

The setTimeout delay of 20ms in close() is much shorter than the 0.2s fade-out animation. Adjust the timeout to match the animation duration for smoother transitions.

Suggested change
}, 20); // 20ms matches the animation duration
}, 200); // 200ms matches the animation duration


private async initialize() {
// Only set initial state to open if it's first launch
console.log("I AM HERE", this.isFirstLaunch);
Copy link

Choose a reason for hiding this comment

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

Remove or update the debug log 'I AM HERE' to avoid unnecessary console output in production.

Suggested change
console.log("I AM HERE", this.isFirstLaunch);

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";

readonly _serviceBrand: undefined;

/**
* Returns the PearOverlayPart instance.
Copy link

Choose a reason for hiding this comment

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

Typographical Inconsistency: The JSDoc comments refer to PearOverlayPart (line 25) and PearAI popup (lines 30-60) whereas the actual implementation and naming in the file use AgentOverlayPart and AgentOverlayService. Please standardize the naming to avoid confusion.

Suggested change
* Returns the PearOverlayPart instance.
* Returns the AgentOverlayPart instance.

Copy link

@Acorn221 Acorn221 left a comment

Choose a reason for hiding this comment

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

🚀 I can't imagine my review would be terribly useful, but I saw nothing that stood out to me as being bad!

// extract out the styles into css files.
// fullscreen? container? webview? popupAreaOverlay? should be just one thing.
// display, opacity, z-index, transition, etc.
// this should be just skeleton, full control should be inside submodule for layout.

Choose a reason for hiding this comment

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

I'm not too familiar with the best way to handle these overlays in the vscode fork but it does seem quite complicated to add in a new overlay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants