-
Notifications
You must be signed in to change notification settings - Fork 121
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
Conversation
WalkthroughThe Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
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
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); | ||
} | ||
|
||
} | ||
} |
There was a problem hiding this comment.
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.
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); | |
} | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ViewPart viewPart = (ViewPart) page.findView("org.eclipse.ui.internal.introview"); | ||
if (viewPart != null) | ||
{ | ||
page.hideView(viewPart); | ||
} |
There was a problem hiding this comment.
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.
@alirana01 hi ! Tested under: The Welcome Page is closed when its open when opening the esp-idf manager view ✔️ LGTM 👍 |
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:
Checklist
Summary by CodeRabbit