Skip to content

Feat: PearAI Creator View Facilitation #227

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

Merged
merged 7 commits into from
May 14, 2025

Conversation

Acorn221
Copy link

@Acorn221 Acorn221 commented Mar 17, 2025

Description

This PR adds in the background code to facilitate a "creator" overlay view/input bar.
It follows the existing patterns as much as possible

Warning

This PR needs to be merged in with this pr in the roo-code repo


Important

Adds a new 'Creator Mode' to PearAI with overlay view, actions, and services for enhanced creator experience.

  • Behavior:
    • Adds Creator Mode with enterCreatorMode(), exitCreatorMode(), and toggleCreatorMode() in layout.ts.
    • New actions ToggleCreatorOverlayAction, CloseCreatorOverlayAction, LockCreatorOverlayAction, and UnlockCreatorOverlayAction in creatorOverlayActions.ts.
    • CreatorOverlayPart in creatorOverlayPart.ts manages the creator overlay view.
  • Services:
    • Introduces ICreatorOverlayService and CreatorOverlayService in creatorOverlayService.ts for managing creator overlay state.
  • Layout and Context:
    • Updates layoutService.ts to include PEARCREATOROVERLAY_PART.
    • Adds InEditorCreatorModeContext and PearAICreatorVisibleContext in contextkeys.ts.
  • Testing:
    • Updates TestLayoutService in workbenchTestServices.ts to include creator mode methods.

This description was created by Ellipsis for c77bc86. 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 1070368 in 5 minutes and 17 seconds

More details
  • Looked at 1132 lines of code in 10 files
  • Skipped 0 files when reviewing.
  • Skipped posting 29 drafted comments based on config settings.
1. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:3
  • Draft comment:
    Refactor inline styles and layout logic. There’s a block comment (lines 3-10) noting the overlay layout is messy; consider moving CSS rules to external files and simplifying open/close functions.
  • 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.
2. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:217
  • Draft comment:
    Use CSS classes instead of repeated inline style assignments. Extract common styling (position, z-index, opacity, transitions) into CSS for maintainability.
  • 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.
3. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:292
  • Draft comment:
    Avoid using hard-coded short timeouts for animations (e.g. 20ms). Instead, consider using CSS transitions and events to determine when to hide elements.
  • 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.
4. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:357
  • Draft comment:
    The open/close/toggle logic appears duplicated. Consider merging similar functionality to reduce code repetition and simplify the API.
  • 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.
5. src/vs/workbench/services/layout/browser/layoutService.ts:90
  • Draft comment:
    The layout service file mostly defines enums and utility functions; ensure that implicit conversions (e.g. positionToString and positionFromString) handle unexpected input robustly.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50%
    None
6. src/vs/workbench/common/contextkeys.ts:153
  • Draft comment:
    Context keys appear well defined with localization. Consider adding tests to validate context key updates when part visibility changes.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50%
    None
7. src/vs/workbench/browser/parts/overlay/creatorView/creatorOverlayActions.ts:9
  • Draft comment:
    Remove commented-out import (line 10) for context key if it is not needed.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
8. src/vs/workbench/browser/parts/overlay/creatorView/creatorOverlayActions.ts:60
  • Draft comment:
    Keybinding for toggle uses Ctrl/Cmd+E; verify no conflicts with other commands.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
9. src/vs/workbench/browser/parts/overlay/creatorView/creatorOverlayPart.ts:187
  • Draft comment:
    Consider moving inline styling (e.g. for overlay container and gradient) out to a CSS file to improve maintainability, as noted in the comments.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
10. src/vs/workbench/browser/parts/overlay/creatorView/creatorOverlayPart.ts:292
  • Draft comment:
    The click handler for closing the overlay is attached but not removed on subsequent opens. Consider storing the listener (as done in the other overlay part) to avoid accumulating duplicate handlers.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
11. src/vs/workbench/browser/parts/overlay/creatorView/creatorOverlayPart.ts:400
  • Draft comment:
    Ensure transition durations and timing (e.g. in hideOverlayLoadingMessage) are consistent with the rest of the UI for smooth animations.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
12. src/vs/workbench/browser/parts/overlay/creatorView/creatorOverlayService.ts:150
  • Draft comment:
    CreatorOverlayService simply delegates to the part; the implementation looks clear and straightforward. No issues.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
13. src/vs/workbench/browser/parts/overlay/pearOverlayActions.ts:29
  • Draft comment:
    Remove or update commented out context conditions (e.g. line 30) if they are no longer applicable.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
14. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:3
  • Draft comment:
    Developer comments highlight issues with maintainability. Consider refactoring to extract CSS and consolidate similar behaviors (open vs. show) to reduce code duplication.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
15. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:313
  • Draft comment:
    The fullScreenOverlay click listener is added on each open() call without removal. Consider managing this listener to prevent multiple registrations.
  • 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.
16. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:333
  • Draft comment:
    The fade-out animation duration of 20ms appears inconsistent with the 300ms transitions seen elsewhere. Review animation durations for consistency.
  • 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.
17. src/vs/workbench/browser/workbench.ts:140
  • Draft comment:
    Workbench initialization looks standard; ensure error handlers and performance marks remain in sync with latest logging guidelines.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
18. src/vs/workbench/common/contextkeys.ts:153
  • Draft comment:
    New context keys for PearAI and Creator overlays are added appropriately. Verify these keys are used consistently in command definitions.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
19. src/vs/workbench/services/layout/browser/layoutService.ts:91
  • Draft comment:
    The enum additions (e.g. PEAROVERLAY_PART and PEARCREATOROVERLAY_PART) and helper functions (positionToString, etc.) appear correct. Ensure that any string values used in CSS classes remain in sync.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
20. src/vs/workbench/browser/actions/layoutActions.ts:185
  • Draft comment:
    Typo: The localization key 'cofigureLayoutIcon' should be corrected to 'configureLayoutIcon' 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.
21. src/vs/workbench/browser/actions/layoutActions.ts:632
  • Draft comment:
    Typo: In the titles for HideEditorActionsAction and ShowEditorActionsAction, 'hideEditorActons' and 'showEditorActons' should be corrected to 'hideEditorActions' and 'showEditorActions' respectively.
  • 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.
22. src/vs/workbench/browser/layout.ts:2574
  • Draft comment:
    Typo: The key 'SIDEBAR_POSITON' appears to be misspelled. Consider renaming it to 'SIDEBAR_POSITION' to improve clarity and avoid confusion.
  • 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.
23. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:5
  • Draft comment:
    Typo: 'Simplyfy' should be corrected to 'Simplify'.
  • 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.
24. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:4
  • Draft comment:
    Typo: Consider changing 'its not maintainable and iterable.' to 'it's not maintainable and iterable.' for proper grammar.
  • 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.
25. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:166
  • Draft comment:
    Typo/Consistency: The log message 'WEBVIEW CreatorOverlayPart SERVICE RESOLVED!' appears inconsistent with the class/component name 'PearOverlayPart'. Consider updating it for consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    While the comment is technically correct about the inconsistency, log messages are typically not critical to code functionality. They are mainly used for debugging. The inconsistency doesn't affect the actual behavior of the code. Additionally, we should be conservative about keeping comments that are purely about logging or debugging.
    The inconsistency could potentially cause confusion during debugging if someone is searching logs for "PearOverlayPart". Also, maintaining consistent naming throughout the codebase, even in logs, is generally good practice.
    While consistency is good, this is a very minor issue that doesn't affect functionality. The log message still clearly indicates what's happening, and fixing it would provide minimal value.
    Delete the comment. While technically correct, comments about log message text are too minor to warrant a PR comment unless they could cause actual confusion or issues.
26. src/vs/workbench/browser/workbench.ts:49
  • Draft comment:
    Typo: 'setProgressAcccessibilitySignalScheduler' seems to be misspelled. Consider renaming it to 'setProgressAccessibilitySignalScheduler' to correct the extra 'c'.
  • 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.
27. src/vs/workbench/browser/workbench.ts:244
  • Draft comment:
    Typo in comment: 'loosing' should be corrected to 'losing' in the phrase 'the chance of loosing any state'.
  • 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.
28. src/vs/workbench/common/contextkeys.ts:162
  • Draft comment:
    Typo: The function name 'getVisbileViewContextKey' contains a typo. Consider renaming it to 'getVisibleViewContextKey' 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.
29. src/vs/workbench/services/layout/browser/layoutService.ts:268
  • Draft comment:
    Typo: In the comment for getPanelAlignment, 'alignement' should be corrected to '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_DZP0KboRChWuO60B


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.

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. Incremental review on c77bc86 in 2 minutes and 7 seconds

More details
  • Looked at 507 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 18 drafted comments based on config settings.
1. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:92
  • Draft comment:
    Remove debug log 'I AM HERE' (likely left for debugging).
  • 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.
2. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:210
  • Draft comment:
    Inline style assignments for overlays (loadingOverlay and popupAreaOverlay) should be refactored into CSS classes for easier maintenance.
  • 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.
3. src/vs/workbench/test/browser/workbenchTestServices.ts:325
  • Draft comment:
    Duplicate stubbing of IUntitledTextEditorService detected; remove one instance to avoid confusion.
  • 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.
4. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:1747
  • Draft comment:
    Invalid display value: 'absolute' is not a valid CSS display property. Consider using a proper value (e.g. 'block') or removing this assignment.
  • 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.
5. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:1762
  • Draft comment:
    The same invalid display value is used for the pearCreatorOverlayPartContainer. Please fix the display property here as well.
  • 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.
6. src/vs/workbench/services/layout/browser/layoutService.ts:1491
  • Draft comment:
    Remove or replace console.log/console.warn debug statements (e.g. 'Entering Creator Mode') with proper logging; avoid leaving debug logs in production code.
  • 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.
7. src/vs/workbench/services/layout/browser/layoutService.ts:1490
  • Draft comment:
    There is substantial duplication between Zen Mode and Creator Mode logic. Consider abstracting shared functionality to reduce maintenance overhead.
  • 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.
8. src/vs/workbench/browser/actions/layoutActions.ts:185
  • Draft comment:
    Typo detected: The key 'cofigureLayoutIcon' should be corrected to 'configureLayoutIcon'.
  • 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.
9. src/vs/workbench/browser/actions/layoutActions.ts:632
  • Draft comment:
    Typo detected: The localization key 'hideEditorActons' should be corrected to 'hideEditorActions' (and similarly for its description) to fix the spelling mistake.
  • 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.
10. src/vs/workbench/browser/actions/layoutActions.ts:656
  • Draft comment:
    Typo detected: The localization key 'showEditorActons' should be corrected to 'showEditorActions' (and similarly for its description) to fix the spelling mistake.
  • 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.
11. src/vs/workbench/browser/actions/layoutActions.ts:740
  • Draft comment:
    Typo detected: The variable name 'oldettingValue' should likely be corrected to 'oldSettingValue' for clarity and consistency.
  • 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/layout.ts:1325
  • Draft comment:
    Typo: change "respecting it's uri" to "respecting its uri" in the comment within the setLineNumbers function in toggleZenMode.
  • 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/browser/parts/overlay/pearOverlayPart.ts:4
  • Draft comment:
    Typo: In the comment on line 4, 'its not maintainable and iterable.' should likely be "it's not maintainable and iterable." (adding the missing apostrophe).
  • 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.
14. src/vs/workbench/browser/parts/overlay/pearOverlayPart.ts:5
  • Draft comment:
    Typo: In the comment on line 5, 'Simplyfy this.' should be corrected to 'Simplify this.'
  • 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.
15. src/vs/workbench/common/contextkeys.ts:163
  • Draft comment:
    Typographical error: The function name 'getVisbileViewContextKey' appears to be misspelled. Consider renaming it to 'getVisibleViewContextKey' 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.
16. src/vs/workbench/services/layout/browser/layoutService.ts:273
  • Draft comment:
    Typographical error: 'alignement' should be corrected to 'alignment' in the documentation for getPanelAlignment.
  • 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.
17. src/vs/workbench/test/browser/workbenchTestServices.ts:400
  • Draft comment:
    Typo: The property name 'instantitionService' appears to be a misspelling. Consider renaming it to 'instantiationService' for consistency.
  • 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.
18. src/vs/workbench/test/browser/workbenchTestServices.ts:2243
  • Draft comment:
    Typographical error: The parameter name 'pariticipant' is misspelled in the registerParticipant method. Please correct it to 'participant'.
  • 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_FDuog9RF6tFHQQdC


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.


const setLineNumbers = (lineNumbers?: LineNumbersType) => {
for (const editor of this.mainPartEditorService.visibleTextEditorControls) {
// To properly reset line numbers we need to read the configuration for each editor respecting it's uri.
Copy link

Choose a reason for hiding this comment

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

Typo: change "respecting it's uri" to "respecting its uri" in the comment within the setLineNumbers function in enterCreatorMode.

Suggested change
// To properly reset line numbers we need to read the configuration for each editor respecting it's uri.
// To properly reset line numbers we need to read the configuration for each editor respecting its uri.

@@ -139,6 +140,11 @@ export interface IWorkbenchLayoutService extends ILayoutService {
*/
readonly onDidChangeZenMode: Event<boolean>;

/**
* Pear AI Zen mode 🚀
Copy link

Choose a reason for hiding this comment

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

Typo in the documentation for onDidChangeCreatorMode: It currently reads 'Pear AI Zen mode 🚀'. Consider changing it to 'Pear AI Creator mode 🚀' to reflect the proper feature.

Suggested change
* Pear AI Zen mode 🚀
* Pear AI Creator mode 🚀

@Acorn221 Acorn221 force-pushed the acorn/211-implement-pearai-creator-view branch from c77bc86 to 1070368 Compare March 17, 2025 21:07
@Acorn221 Acorn221 merged commit 2750985 into main May 14, 2025
3 of 11 checks passed
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.

1 participant