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

IEP-1268: Welcome page closed when opening ESP-IDF Manager #1005

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

alirana01
Copy link
Collaborator

@alirana01 alirana01 commented Jun 26, 2024

Description

The welcome page is closed when its open when opening the esp-idf manager view

Fixes # (IEP-1268)

How has this been tested?

Launch in clean workspace and click open ESP-IDF Manager view it should close the welcome page.

Test Configuration:

  • ESP-IDF Version: any
  • OS (Windows,Linux and macOS): all

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

  • New Features
    • Enhanced UI management in Eclipse: Specific views can now be hidden before opening an editor, offering a more streamlined user experience.

@alirana01 alirana01 self-assigned this Jun 26, 2024
Copy link

coderabbitai bot commented Jun 26, 2024

Walkthrough

The ManageEspIdfVersionsHandler class has been updated to include functionality that hides a specific view in the Eclipse UI before an editor is opened. Additionally, modifications have been made to the launchEditor method to handle file operations and manage the editor opening process more effectively.

Changes

Files Change Summary
bundles/.../ui/tools/ManageEspIdfVersionsHandler.java Added logic to hide specific views in Eclipse UI before opening an editor. Updated launchEditor to handle file operations and editor management. Included new imports for IWorkbenchPage and ViewPart.

Poem

In codes and files, changes brew,
Eclipse hides a view anew,
Editors open, tasks align,
Through Java streams, the bytes refine.
In tools we trust, in code we write,
Espressif's path shines ever bright.
🌟👩‍💻✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3321cc0 and 5906da4.

Files selected for processing (1)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ManageEspIdfVersionsHandler.java (4 hunks)
Additional comments not posted (1)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ManageEspIdfVersionsHandler.java (1)

13-13: Import statements approved.

The new imports are essential for the updated functionality in the launchEditor method, where UI elements are being manipulated.

Also applies to: 17-17

Comment on lines +42 to +54
if (activeww != null)
{
IWorkbenchPage page = activeww.getActivePage();
if (page != null)
{
ViewPart viewPart = (ViewPart) page.findView("org.eclipse.ui.internal.introview");
if (viewPart != null)
{
page.hideView(viewPart);
}

}
}
Copy link

Choose a reason for hiding this comment

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

Ensure robustness in UI manipulation.

The logic to hide the welcome page is implemented correctly. However, consider adding a type check before casting the view to ViewPart to avoid potential ClassCastException.

- ViewPart viewPart = (ViewPart) page.findView("org.eclipse.ui.internal.introview");
+ IViewPart viewPart = page.findView("org.eclipse.ui.internal.introview");
+ if (viewPart instanceof ViewPart) {
+     page.hideView((ViewPart)viewPart);
+ }
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (activeww != null)
{
IWorkbenchPage page = activeww.getActivePage();
if (page != null)
{
ViewPart viewPart = (ViewPart) page.findView("org.eclipse.ui.internal.introview");
if (viewPart != null)
{
page.hideView(viewPart);
}
}
}
if (activeww != null)
{
IWorkbenchPage page = activeww.getActivePage();
if (page != null)
{
IViewPart viewPart = page.findView("org.eclipse.ui.internal.introview");
if (viewPart instanceof ViewPart)
{
page.hideView((ViewPart)viewPart);
}
}
}

Copy link
Collaborator

@kolipakakondal kolipakakondal left a comment

Choose a reason for hiding this comment

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

LGTM

@kolipakakondal kolipakakondal added this to the v3.0.1 milestone Jun 26, 2024
Copy link
Collaborator

@sigmaaa sigmaaa left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +47 to +51
ViewPart viewPart = (ViewPart) page.findView("org.eclipse.ui.internal.introview");
if (viewPart != null)
{
page.hideView(viewPart);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: ViewPart casting is not necessary here. We can use IViewPart instead of ViewPart. Also, we don't need if (viewPart != null), because it's a part of the page.hideView(IViewPart) method.

@AndriiFilippov
Copy link
Collaborator

@alirana01 hi !

Tested under:
OS - Windows 10 / MacOS

The Welcome Page is closed when its open when opening the esp-idf manager view ✔️
Open workspace - click links on Welcome Page - > open Tools Manager - > Welcome Page is closing itself ✔️

LGTM 👍

@kolipakakondal kolipakakondal merged commit b8ad8bf into master Jul 3, 2024
7 checks passed
@kolipakakondal kolipakakondal deleted the IEP-1268 branch July 3, 2024 16:25
@kolipakakondal kolipakakondal modified the milestones: v3.0.1, v3.1.0 Sep 4, 2024
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.

4 participants