Skip to content

fix: attemp to fix welcome page with showIntro#1396

Draft
sigmaaa wants to merge 2 commits intomasterfrom
fix_welcome_page
Draft

fix: attemp to fix welcome page with showIntro#1396
sigmaaa wants to merge 2 commits intomasterfrom
fix_welcome_page

Conversation

@sigmaaa
Copy link
Collaborator

@sigmaaa sigmaaa commented Feb 9, 2026

Description

Please include a summary of the change and which issue is fixed.

Fixes # (IEP-XXX)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

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

Dependent components impacted by this PR:

  • Component 1
  • Component 2

Checklist

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

Summary by CodeRabbit

  • New Features
    • Application now displays an introductory screen at startup to help users get started.
  • Bug Fixes
    • Improved startup behavior so the intro reliably refreshes (closes and reopens) during early launch, ensuring the correct intro view is shown.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

Adds logic to EspressifToolStartup to close and re-show the Eclipse Intro during early startup via PlatformUI and the IntroManager; cleans up a duplicate LaunchResult import.

Changes

Cohort / File(s) Summary
Intro UI startup handling
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/EspressifToolStartup.java
Adds PlatformUI/IIntroPart imports and a restoreIntroPage call in earlyStartup that runs on the UI thread, closes any existing intro via IntroManager.getIntro() and calls showIntro; removes duplicate LaunchResult import.

Sequence Diagram(s)

sequenceDiagram
    participant Startup as EspressifToolStartup
    participant Workbench as PlatformUI/Workbench
    participant IntroMgr as IntroManager
    participant Window as ActiveWorkbenchWindow
    Startup->>Workbench: call getWorkbench()
    Workbench->>IntroMgr: getIntroManager().getIntro()
    IntroMgr-->>Startup: IIntroPart (or null)
    Startup->>Window: asyncExec on UI thread
    alt intro exists
        Window->>IntroMgr: closeIntro(IIntroPart)
    end
    Window->>IntroMgr: showIntro(Window)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • kolipakakondal
  • AndriiFilippov

Poem

🐰 At dawn the workspace wakes anew,

I hop and nudge the intro through,
Closed, then shown on the UI lane,
A tiny hop — the welcome's sane,
Hooray for clean imports and fresh display!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references the main change (fixing welcome page with showIntro), matching the commit message and code changes that introduce intro page restoration logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_welcome_page

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🤖 Fix all issues with AI agents
In
`@bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/EspressifToolStartup.java`:
- Around line 75-81: The UI calls in earlyStartup() (calls to
PlatformUI.getWorkbench().getIntroManager().getIntro(),
getActiveWorkbenchWindow(), and showIntro()) run off the UI thread and can throw
SWTException or see a null window; wrap the logic in
Display.getDefault().asyncExec(() -> { ... }) and inside the Runnable re-check
that IIntroPart introPart =
PlatformUI.getWorkbench().getIntroManager().getIntro() is non-null and that
PlatformUI.getWorkbench().getActiveWorkbenchWindow() is non-null before calling
showIntro(..., false) to ensure thread-safety and null-safety.

Comment on lines +75 to +81
IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();

if (introPart != null)
{
PlatformUI.getWorkbench().getIntroManager().showIntro(PlatformUI.getWorkbench().getActiveWorkbenchWindow(),
false);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

earlyStartup() runs on a non-UI thread — these UI calls will throw SWTException or get a null window.

Per the Eclipse IStartup contract, earlyStartup() is invoked on a background thread. Directly calling getIntro(), getActiveWorkbenchWindow(), and showIntro() here will either raise an SWTException: Invalid thread access or return null for the active window. Every other UI operation in this class correctly wraps calls in Display.getDefault().asyncExec()/syncExec().

Additionally, even with Display wrapping, the active workbench window may not yet be available at early startup time — a null-check on the window is advisable.

Proposed fix: wrap in Display.asyncExec with null-safety
 	public void earlyStartup()
 	{
-		IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
-
-		if (introPart != null)
-		{
-			PlatformUI.getWorkbench().getIntroManager().showIntro(PlatformUI.getWorkbench().getActiveWorkbenchWindow(),
-					false);
-		}
+		Display.getDefault().asyncExec(() -> {
+			IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
+			if (introPart != null)
+			{
+				IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+				if (window != null)
+				{
+					PlatformUI.getWorkbench().getIntroManager().showIntro(window, false);
+				}
+			}
+		});
 		preferences = org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE.getNode(UIPlugin.PLUGIN_ID);
📝 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
IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
if (introPart != null)
{
PlatformUI.getWorkbench().getIntroManager().showIntro(PlatformUI.getWorkbench().getActiveWorkbenchWindow(),
false);
}
Display.getDefault().asyncExec(() -> {
IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
if (introPart != null)
{
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null)
{
PlatformUI.getWorkbench().getIntroManager().showIntro(window, false);
}
}
});
🤖 Prompt for AI Agents
In
`@bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/EspressifToolStartup.java`
around lines 75 - 81, The UI calls in earlyStartup() (calls to
PlatformUI.getWorkbench().getIntroManager().getIntro(),
getActiveWorkbenchWindow(), and showIntro()) run off the UI thread and can throw
SWTException or see a null window; wrap the logic in
Display.getDefault().asyncExec(() -> { ... }) and inside the Runnable re-check
that IIntroPart introPart =
PlatformUI.getWorkbench().getIntroManager().getIntro() is non-null and that
PlatformUI.getWorkbench().getActiveWorkbenchWindow() is non-null before calling
showIntro(..., false) to ensure thread-safety and null-safety.

@sigmaaa
Copy link
Collaborator Author

sigmaaa commented Feb 10, 2026

Tested: this solution doesn't work

@sigmaaa sigmaaa marked this pull request as draft February 10, 2026 13:15
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