Skip to content

#1802 GUI State management implementation#1807

Open
laim2003 wants to merge 44 commits into
devonfw:mainfrom
laim2003:#1802-state-management-implementation
Open

#1802 GUI State management implementation#1807
laim2003 wants to merge 44 commits into
devonfw:mainfrom
laim2003:#1802-state-management-implementation

Conversation

@laim2003
Copy link
Copy Markdown
Contributor

@laim2003 laim2003 commented Apr 9, 2026

This PR fixes #1802

Implemented changes:

  • Implemented basic State Management for the IdeContext in the GUI
  • State management should be thread safe: Thread safe singleton implementation
  • Added custom adaption of JavaFXs alert class for IDEasy

Main points:

  • Basic state management
  • Start-context <-> context seperation
  • Ensure thread safety
  • Callback pattern for any dependent compontents

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal

laim2003 added 13 commits March 27, 2026 17:52
- Added logging to IdeGuiStateManager.
- Added functionality, that selecting a different project now switches the IdeContext to the new project.
- Added logging to IdeGuiStateManager.
- Added functionality, that selecting a different project now switches the IdeContext to the new project.
- Added functionality, that selecting a different project now switches the IdeContext to the new project.
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Apr 9, 2026
@laim2003 laim2003 self-assigned this Apr 9, 2026
@laim2003 laim2003 added GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx bugfix PR that fixes a bug issue core FileAccess, ProcessUtil, IdeContext, etc. labels Apr 9, 2026
@laim2003 laim2003 moved this from 🆕 New to 🏗 In progress in IDEasy board Apr 9, 2026
- added DI for IdeGuiStateManager.switchContext
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 9, 2026

Coverage Report for CI Build 25731784551

Coverage increased (+0.06%) to 70.686%

Details

  • Coverage increased (+0.06%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 31 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

31 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/ide/gui/MainController.java 17 64.0%
com/devonfw/ide/gui/App.java 13 0.0%
com/devonfw/ide/gui/AppLauncher.java 1 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 15567
Covered Lines: 11458
Line Coverage: 73.6%
Relevant Branches: 6934
Covered Branches: 4447
Branch Coverage: 64.13%
Branches in Coverage %: Yes
Coverage Strength: 3.11 hits per line

💛 - Coveralls

@laim2003 laim2003 added the internal Nothing to be added to CHANGELOG, only internal story label Apr 14, 2026
@laim2003 laim2003 moved this from 🏗 In progress to Team Review in IDEasy board Apr 24, 2026
@laim2003 laim2003 moved this from Team Review to 🏗 In progress in IDEasy board Apr 28, 2026
- not automatically select a workspace
- to seperate concerns of which functions update the workspace combobox and which the project combobox
…low new Select-Project-Then-Select-Workspace UI logic (previous commit)
@laim2003 laim2003 force-pushed the #1802-state-management-implementation branch from 459f762 to 6c44432 Compare April 28, 2026 17:28
@laim2003 laim2003 moved this from 🏗 In progress to Team Review in IDEasy board Apr 28, 2026
@laim2003 laim2003 marked this pull request as ready for review April 30, 2026 08:34
@laim2003 laim2003 moved this from Team Review to 👀 In review in IDEasy board May 2, 2026
Copy link
Copy Markdown
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

@laim2003 thanks for your PR.
I like the general design and you added many valuable fixes and improvements for the GUI.
I still have some doubts about the singleton and static member access approach.
Typically this will sooner or later cause trouble.
Maybe we can avoid this where possible.

Please avoid this extensive copy&paste of pointless and confusing properties, plugin settings that are never used, etc.
The golden rule for ide-projects for test is to keep them as minimalistic as possible.
Every line from such file and every entire file that can be removed without the test failing should be removed.

Comment thread cli/pom.xml
Comment on lines -141 to -142

<!-- jar for test classes -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why removing this comment that could be helpful to explain the execution?

import java.util.List;
import java.util.stream.Stream;

import org.jline.utils.Log;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is IMHO the wrong logger

Comment on lines +20 to +21
private final ArrayList<String> projectNames = new ArrayList<>();
private final HashMap<String, ArrayList<String>> workspaces = new HashMap<>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

https://github.com/devonfw/IDEasy/blob/main/documentation/contributing/coding-conventions.adoc#prefer-general-api

Suggested change
private final ArrayList<String> projectNames = new ArrayList<>();
private final HashMap<String, ArrayList<String>> workspaces = new HashMap<>();
private final List<String> projectNames = new ArrayList<>();
private final Map<String, List<String>> workspaces = new HashMap<>();

You can even create custom Java classes to add more semantics since structures like Map<String, List<String> are hard to understand. If it was Map<String, Workspaces> it would be easier to understand esp. when Workspaces has reasonable JavaDoc.
However, I would question why we should store and cache the workspaces for all projects...
Your current code will never refresh the caches (surely you could be calling refreshProjects()) and therefore never shows updated information when a new workspace is created after the GUI was launched. When a project is changed, we should IMHO always refresh the newly selected project's workspaces and afford the 20ms to read them from the disc (again).

Comment on lines +4 to +13
DOCKER_EDITION=docker
FOO=foo-${BAR}
TEST_ARGS1=${TEST_ARGS1} user1
TEST_ARGS2=${TEST_ARGS2} user2
TEST_ARGS3=${TEST_ARGS3} user3
TEST_ARGS7=user7
TEST_ARGS10=user10
TEST_ARGSb=userb
TEST_ARGSc=${TEST_ARGS1} userc
TEST_ARGSd=${TEST_ARGS1} userd
Copy link
Copy Markdown
Member

@hohwille hohwille May 22, 2026

Choose a reason for hiding this comment

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

the basic project was the first ide-project that we created.
It was misused later by many testers who were too lazy to create a new ide-project for their specific purpose.
Therefore all crazy things ended up in this basic project.
Please not not copy & paste all this mess into the gui module.
Nobody will ever understand why we have this here in gui and the true answer will be: "for nothing"...

Comment on lines +4 to +13
DOCKER_EDITION=docker
FOO=foo-${BAR}
TEST_ARGS1=${TEST_ARGS1} user1
TEST_ARGS2=${TEST_ARGS2} user2
TEST_ARGS3=${TEST_ARGS3} user3
TEST_ARGS7=user7
TEST_ARGS10=user10
TEST_ARGSb=userb
TEST_ARGSc=${TEST_ARGS1} userc
TEST_ARGSd=${TEST_ARGS1} userd
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:)

Comment on lines +4 to +9
JAVA_VERSION=17*
MVN_VERSION=3.9.0
ECLIPSE_VERSION=2023-03
INTELLIJ_EDITION=ultimate
IDE_TOOLS=mvn,eclipse
BAR=bar-${SOME}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:)

Comment on lines +4 to +13
DOCKER_EDITION=docker
FOO=foo-${BAR}
TEST_ARGS1=${TEST_ARGS1} user1
TEST_ARGS2=${TEST_ARGS2} user2
TEST_ARGS3=${TEST_ARGS3} user3
TEST_ARGS7=user7
TEST_ARGS10=user10
TEST_ARGSb=userb
TEST_ARGSc=${TEST_ARGS1} userc
TEST_ARGSd=${TEST_ARGS1} userd
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:)

Comment on lines +4 to +13
DOCKER_EDITION=docker
FOO=foo-${BAR}
TEST_ARGS1=${TEST_ARGS1} user1
TEST_ARGS2=${TEST_ARGS2} user2
TEST_ARGS3=${TEST_ARGS3} user3
TEST_ARGS7=user7
TEST_ARGS10=user10
TEST_ARGSb=userb
TEST_ARGSc=${TEST_ARGS1} userc
TEST_ARGSd=${TEST_ARGS1} userd
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:)

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

Labels

bugfix PR that fixes a bug issue core FileAccess, ProcessUtil, IdeContext, etc. GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx internal Nothing to be added to CHANGELOG, only internal story

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Enable state management for the IdeContext in the GUI.

3 participants