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

feat: splash screen support for Electron #13505

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

sdirix
Copy link
Member

@sdirix sdirix commented Mar 19, 2024

What it does

Enhances the ElectronMainApplication to optionally render a splash screen until the frontend is ready.

The splash screen can be configured via the application config object theia.frontend.config.electron.splashScreenOptions. Mandatory is the option content which specifies a relative path from the frontend location to the content of the splash screen. Optionally width, height, minDuration and maxDuration can be handed over too.

By default the splash screen is off.

Implements #13410

Contributed on behalf of Pragmatiqu IT GmbH

TheiaSplashScreen.webm

How to test

  1. Place a png in examples/electron/resources/ directory

  2. Modify the Electron example application package.json to configure the splash screen, e.g. like this

    "theia": {
      "target": "electron",
      "frontend": {
        "config": {
          "applicationName": "Theia Electron Example",
          "reloadOnReconnect": true,
          "electron": {
            "splashScreenOptions": {
              "content": "resources/my-logo.png"
            }
          }
        }
      },
      "backend": {
        "config": {
          "frontendConnectionTimeout": -1
        }
      }
    }
    
  3. Build and start the Electron example app

Play around with the various options, e.g. hand over a html file as the content and try the configuration options width, height, minDuration and maxDuration.

The PR now also configured the Electron example app already

Review checklist

Reminder for reviewers

@tsmaeder
Copy link
Contributor

The lib/frontend directory of an application is generated. What's the suggested process for putting something in there for adopters? Can we have our electron example implement this way?

@sdirix
Copy link
Member Author

sdirix commented Mar 21, 2024

The lib/frontend directory of an application is generated. What's the suggested process for putting something in there for adopters?

I chose lib/frontend as this is often chosen for resolving files. I imagined users placing files in there like we do already: Via webpack. However it might not be the best place as it's then also served vie Express which we might not want.

So, I agree, it's probably better to simply resolve from the root of the electron application instead.

Can we have our electron example implement this way?

Locally I adapted the Electron example app for testing. I was unsure whether we wanted to make the splash screen the "default", so I did not modify it in the PR. Would you like to see it configured in the example?

@tsmaeder
Copy link
Contributor

Would you like to see it configured in the example?

Yes, I think that would neatly document how it's done.

@sdirix
Copy link
Member Author

sdirix commented Mar 25, 2024

Would you like to see it configured in the example?

Yes, I think that would neatly document how it's done.

Done 👍

Copy link
Contributor

@tsmaeder tsmaeder left a comment

Choose a reason for hiding this comment

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

One last comment.

@sdirix
Copy link
Member Author

sdirix commented Mar 26, 2024

Rebased to solve merge conflicts in changelog

@sdirix
Copy link
Member Author

sdirix commented Mar 27, 2024

What don't we just make the type of showWindowEarly to be boolean | SplashScreenOptions? This would make the state space of the application simpler.

I thought about this: Maybe it would actually be better to split them. And showWindowEarly then controls whether we show the splash screen / main window before or after the window is ready to show content. I think that makes it more explicit and is actually a sensible option for both use cases.

@tsmaeder
Copy link
Contributor

showWindowEarly then controls whether we show the splash screen / main window before or after the window is ready to show content.

Why configure a splash screen if you don't show it? So splashScreeen/false is a combination that never makes sense.

@sdirix
Copy link
Member Author

sdirix commented Mar 27, 2024

showWindowEarly then controls whether we show the splash screen / main window before or after the window is ready to show content.

Why configure a splash screen if you don't show it? So splashScreeen/false is a combination that never makes sense.

What I meant is:

  • showWindowEarly currently controls whether we show the main window early (i.e. immediately) or after the window sends the ready-to-show message
  • So we can keep this behavior also for the splash screen, i.e. in case we show a splash screen, the showWindowEarly should be interpreted for the splash screen, not for the main window. So then depending on the showWindowEarly we show the splash screen before or after the ready-to-show message.

I think that makes sense as some users might dislike the blank window which is we why allow to configure showWindowEarly in the first case.

@tsmaeder
Copy link
Contributor

tsmaeder commented Mar 27, 2024

@sdirix I would be fine to merge this one with the behavior as it is in order to have it in the release and do whatever fiddling we still want later. However, I would rather not have adopters change the configuration twice in short succession, so if you want to change the config syntax, I would rather have it in this PR. The pre-release window is closing 🤷 .

@sdirix
Copy link
Member Author

sdirix commented Mar 27, 2024

I added the discussed changes and split the options again. I slightly adjusted the splash screen location determination to consider the center point of the Theia application. Before when Theia was closed with only 5 pixels on the left of two screens, the splash screen would be shown left instead of the right.

@sdirix sdirix force-pushed the splash-screen branch 3 times, most recently from 8826c67 to f2c8380 Compare March 27, 2024 21:36
Enhances the ElectronMainApplication to optionally render a splash
screen until the frontend is ready.

The splash screen can be configured via the application config object
"theia.frontend.config.electron.splashScreenOptions". Mandatory is the
option "content" which specifies a relative path from the application
root to the content of the splash screen. Optionally "width", "height",
"minDuration" and "maxDuration" can be handed over too.

Configures the Electron example application to show a Theia logo splash
screen.

Implements eclipse-theia#13410

Contributed on behalf of Pragmatiqu IT GmbH
@sdirix
Copy link
Member Author

sdirix commented Mar 27, 2024

I noticed a regression during testing and refactored the code. The issue was that I previously added the preventAutomaticShow to the default window options. That's fine for the first window, but not for all other windows which are created later, e.g. via the "New Window" action.

I now only add the preventAutomaticShow when we actually are currently showing (or intending to show) a splash screen. This prevents the issue.
To avoid breaking changes I also reverted the change to getLastWindowOptions which I had refactored from async to sync. However if someone actually relies on that being async for their customizations, their code would break.

I think the code is now cleaner than before. It works well for me in testing.

@sdirix sdirix requested a review from tsmaeder March 27, 2024 21:45
@tsmaeder
Copy link
Contributor

@sdirix btw.: usually, we leave updates to the PR in separate commits until merge time so that reviewers don't have to review everything again when comments are being addressed.

@@ -307,6 +405,10 @@ export class ElectronMainApplication {
async createWindow(asyncOptions: MaybePromise<TheiaBrowserWindowOptions> = this.getDefaultTheiaWindowOptions()): Promise<BrowserWindow> {
let options = await asyncOptions;
options = this.avoidOverlap(options);
if (this.splashScreenState) {
Copy link
Contributor

Choose a reason for hiding this comment

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

By accessing the splashScreenState, we're making this order-dependent. Why not use isShowSplashScreen()?

Copy link
Member Author

Choose a reason for hiding this comment

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

isShowSplashScreen() will return true for the lifetime of the application as it's just about the configuration of a splash screen. this.splashScreenState only exist during the time we actually want to show a splash screen

* This can be prevented by handing over preventAutomaticShow: `true`.
* Use this for fine-grained control over when to show the window, e.g. to coordinate with a splash screen.
*/
preventAutomaticShow?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to prevent the main window from showing as soon as it's ready? I don't see the use case and it makes the window state graph more complicated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not add an "open" call to TheiaElectronWindow and inoke it from the ElectronMainApplication class?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we really need to prevent the main window from showing as soon as it's ready? I don't see the use case and it makes the window state graph more complicated.

The splash screen was intended as an alternative to the loading spinner of the main window. If we don't prevent the automatic show of the main window we will see the splash screen as well as the full main window at the same time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why not add an "open" call to TheiaElectronWindow and inoke it from the ElectronMainApplication class?

Sadly, I don't understand what you mean. What is the purpose of that open and when shall it be called?

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea would be that the ElectronMainApplication controls visibility of the windows instead of passing flags to the window and letting the window manage it's own visiblity.

this.splashScreenState = undefined;
};

TheiaRendererAPI.onApplicationStateChanged(window.webContents, state => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is correct: before, the main window would show when the ready-to-show even on the window would fire. applicationState === 'ready' may at a different time.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the same behavior as in the previous state of the PR. The preventAutomaticShow was always part of the PR.

The idea of the splash screen is that the splash screen closes and the main window is shown as soon as the loading spinner is gone, i.e. when the frontend state is set to "ready". You can see the attached video in the PR that no loading spinner is visible.

});
// maxTime should always exist here, sanity fallback
const maxTime = this.splashScreenState.maxTime ?? new Promise(resolve => setTimeout(() => resolve(), 30000));
maxTime.then(() => showWindowAndCloseSplashScreen());
Copy link
Contributor

Choose a reason for hiding this comment

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

If the window is not ready and we do not have showWindowEarly we should not show the window yet, even if we're hiding the splash screen.

Copy link
Member Author

Choose a reason for hiding this comment

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

In my opinion we should always show something. So if the splash screen is force closed via maxTime, we show the current state of the main window.

@tsmaeder
Copy link
Contributor

Sorry about this being a bit late, but doing another pass got me thinking:

  1. Taking showWindowEarly and splashScreenOptions apart has made things more complicated, IMO.
  2. Does it even make sense to show an empty Window if we have splash screen support?
  3. If we always created the initial Window early, we could immediately set up the splash-screen handling in showSplashScreen, instead of potentially adding it to every new window in configureShowOnSplashScreenClose()

@tsmaeder
Copy link
Contributor

For me, the determination of the screen to show the splash screen on does not work: if I move the window to my second screen, and restart, the splash still shows on the main screen.

@sdirix
Copy link
Member Author

sdirix commented Mar 28, 2024

Sorry about this being a bit late, but doing another pass got me thinking:

No worries. We should get this right.

  1. Taking showWindowEarly and splashScreenOptions apart has made things more complicated, IMO.

The code is more logical in my opinion. These are now just two separate options. showWindowEarly is about whether the first rendered window (no matter whether that's the main window or the splash screen) shall be shown as early as possible, even when this means looking at a blank window.

splashScreenOptions is just for configuring optional splash screen content.

  1. Does it even make sense to show an empty Window if we have splash screen support?

Yes. There are proponents for and against splash screens. We can't force everyone to use a splash screen for earliest possible visual feedback

  1. If we always created the initial Window early, we could immediately set up the splash-screen handling in showSplashScreen, instead of potentially adding it to every new window in configureShowOnSplashScreenClose()

That's a good point. We could create the window early but just not show it.

The reason I added it to createWindow thinking about use cases where multiple windows might be opened while the splash screen is shown, however that might be too much of an edge case to be worth it.

Rework splash screen implementation to solely apply to the initial
window. Also removes additional state handling to make the core more
straightforward.

Contributed on behalf of Pragmatiqu IT GmbH
@sdirix sdirix requested a review from tsmaeder April 2, 2024 11:27
@sdirix
Copy link
Member Author

sdirix commented Apr 9, 2024

@tsmaeder Can you review again? Thanks!

}
splashScreenWindow.close();
};
TheiaRendererAPI.onApplicationStateChanged(mainWindow.webContents, state => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the right event or should we just wait until the browser window has finished loading it's content?

Copy link
Member Author

@sdirix sdirix Apr 15, 2024

Choose a reason for hiding this comment

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

The idea is to wait until the frontend is ready to show real content. Otherwise the splash screen will just be shown less than 500ms before being replaced by the main window showing a loading spinner.

You can see this in the video: The splash screen is shown and the main window is shown without any loading spinner (as it's already gone)

* This can be prevented by handing over preventAutomaticShow: `true`.
* Use this for fine-grained control over when to show the window, e.g. to coordinate with a splash screen.
*/
preventAutomaticShow?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

The idea would be that the ElectronMainApplication controls visibility of the windows instead of passing flags to the window and letting the window manage it's own visiblity.

@sdirix
Copy link
Member Author

sdirix commented Apr 15, 2024

The idea would be that the ElectronMainApplication controls visibility of the windows instead of passing flags to the window and letting the window manage it's own visiblity.

Fine with me, I can refactor this

@sdirix
Copy link
Member Author

sdirix commented Apr 28, 2024

The idea would be that the ElectronMainApplication controls visibility of the windows instead of passing flags to the window and letting the window manage it's own visiblity.

Fine with me, I can refactor this

I had a look at this and I'm not sure we're gaining much. The issue is that we can't handle the "automatic" opening within the createWindow function by itself as we're lacking context there whether we want to open the window or not. So we would either need to a new parameter to createWindow to indicate whether the window shall be automatically opened (essentially exchanging one new parameter with another) or adapt all createWindow callers. There are three callers, so that would be manageable, but all three need to be adapted then with this additional logic. Additionally createWindow is public API, so if any consumer is using that already for their use cases, we will break them.

If you still prefer that we adapt the logic of the BrowserWindow then let me know.

@sdirix
Copy link
Member Author

sdirix commented Apr 28, 2024

Note that the Playwright tests are currently failing in all PRs, so this is unrelated to this PR.

@tsmaeder tsmaeder merged commit 90c6334 into eclipse-theia:master Apr 29, 2024
13 of 14 checks passed
@jfaltermeier jfaltermeier added this to the 1.49.0 milestone Apr 29, 2024
dorateq added a commit to dorateq/theia that referenced this pull request Oct 26, 2024
* Generate Extension Info in server application (#13590)

fixes #13481

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* fixes clear cell outputs command and improves toolbar creation (#13640)

* fixes clear cell outputs command and improves toolbar creation

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fix output mime type change

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fix change presentation somtimes firing on old output

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* removed console logs

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* removed additional forgotten console.log

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Reorder back-end plugin deployment to prevent early promise resolution (#13643)

Workaround for #13638

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix spawn calls for node LTS versions (#13614)

* Update DropMetada and documentPaste proposed API for 1.88 compatibility (#13632)

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Bump API version to 1.88.1 (#13646)

Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Translation update for version 1.49.0 (#13654)

Co-authored-by: jfaltermeier <jfaltermeier@eclipsesource.com>

* feat: splash screen support for Electron (#13505)

Enhances the ElectronMainApplication to optionally render a splash
screen until the frontend is ready.

The splash screen can be configured via the application config object
"theia.frontend.config.electron.splashScreenOptions". Mandatory is the
option "content" which specifies a relative path from the application
root to the content of the splash screen. Optionally "width", "height",
"minDuration" and "maxDuration" can be handed over too.

Configures the Electron example application to show a Theia logo splash
screen.

Implements #13410

Contributed on behalf of Pragmatiqu IT GmbH

* Fix unix terminals for bundled apps (#13658)

* core: update re-exports for 1.49.0

* v1.49.0

* docs: updated changelog for 1.49.0

Contributed on behalf of STMicroelectronics

* Fix incorrect URI conversions in `custom-editors-main.ts` (#13653)

* select next node when on first or last line of editor (#13656)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Add dummy command to fix github authentication built-int flows (#13611)

Also includes code to consider sessions which are not created, but
restored from storage at registration time

Fixes #13599
Partial fix for #12821

Contributed on behalof of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Use transitive binding for TerminalFrontendContribution (#13667)

Allows downstream to customize the frontend lifecycle behavior of the TerminalFrontendContribution class.

Signed-off-by: Leo Zhu <yifu.zhu@microchip.com>

* Added additional css to notebook output webviews (#13666)

* Added additional css to notebook ooutput webviews

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* renamed symbol to be more descriptive

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Fixed storing of the notebook-outlineview state data (#13648)

* fixed storing of the notebook-outlineview state data

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed is function and URI handling

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* improved is method for NotebookCellOutlineNode

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Align to vscode notebook commands (#13645)

* aligned commands to vscodes commands
this makes more keybindings available.
Also implements to notbookOutputInputFocused context key

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed type and forgotten dispose of emitter

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Use responsive design for the main notebook toolbar (#13663)

* main toolbar adjusting to maximum size by putting items in to a context menu

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed memory leak

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed issues with max and min hidden items

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed when incresing width of notebook

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Improve notebook cell model lifecycle (#13675)

* Handle `isFileSystemResource` context key (#13664)

* Update built-ins to 1.88.1 level (#13673)

Contributed on behalf of ST Microelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix "Open With..." command visibility (#13678)

* chore: refer to commit sha of actions instead of tags (#13625)

Instead of using tags to refer to a version of an action
(e.g. `actions/checkout@v3`), we now use its commit sha.

The problem with tags is that they are mutable and can be
changed to point to a different commit. This opens a vector
for supply chain attacks.

For one action, the user account had been renamed from
'nick-invision' to 'nick-fields' which caused a redirect
when resolving the action with the old username.
This is potentially dangerous when the account name gets
claimed again, so we now use the new user name
to refer to the action.

Increases the version of the create-pull-request action
from v4 to v6 to have matching versions of the action across
workflows.

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>

* Stub `registerMappedEditProvider` (#13681)

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* chore: update electron to ^28.2.8 (#13580)

Updates the Electron dependency to ^28.2.8 which is also used in VS
Code.

Additional changes:
 - update electron-mocha to ^12.3.0 to fix the Electron smoke test
 - adds a workaround for a type clash in rebuild.ts

* Improve support for creating new notebooks (#13696)

* Added basics for notebook cell drag image renderers (#13698)

* added basics for drag image renderers and improved basic drag image slightly

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fix lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* reiew chages

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Remove git Theia extension from examples (#13274)

* Fail tests if selected repo is undefined
* Fix handling selected repository
* Wait more robustly for dismissal of widgets via escape.

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
Co-authored-by: Thomas Mäder <t.s.maeder@gmail.com>

* Stop execution when deleting cell (#13701)

* Stop execution when deleting cell

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Perform yarn upgrade (#13423)

The commit performs a `yarn upgrade` of the framework to better
represent what downstream applications pull with our version ranges, and
to resolve known security vulnerabilities which were pulled by our
lockfile. The changes also make sure that our declared ranges for
dependencies are correct and fixes any compilation errors.

Contributed on behalf of STMicroelectronics

* Make browserWindow of splashScreen transparent (#13699)

Currently an image with a transparent background is rendered with a white background.
This looks weird and is not the expected behavior when a transparent image is used.
With this change the browserWindow is set to transparent, so that the background is not rendered.
If adoptors want a white background they can simply use an image with a white background (or any other color).

* Don't reveal the focused element when updating the tree rows (#13703)

Fixes #13461

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* TreeWidget: Ensure globalSelection is correctly set when opening context menu (#13710)

* TreeWidget: Ensure globalSelection is correctly set when opening context menu

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* nicer solution than only checking when opening context menu

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* removed forgotten artifact

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Support plugin copying for remote feature (#13369)

* fix: do not override user-defined THEIA_CONFIG_DIR (#13708)

Fixes #13700

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>

* doc: improve WebSocketConnectionProvider deprecation message (#13713)

The current deprecation message leads to confusion as the referenced class is not exported and not usable as an injection symbol.
The message is improved and the new ServiceConnectionProvider is exported.

Contributed on behalf of STMicroelectronics

* notebook: Select the Last Cell when deleting selected last cell (#13715)

* notebook: Select the Last Cell when deleting selected cell with index larger than avaialable cells

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* better length check

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Refactor auto save mechanism (#13683)

* Upgrade the Theia build to use Typescript 5.4.5 (#13628)

Most changes are just typing to accomodate stricter checks in 5.4.5.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix README documentation link (#13726)

* Update msgpckr to 1.10.2 (#13722)

Fixes #13532

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix ESLint on Windows (#13731)

* Delegate showing help to the back end process. (#13729)

Fixes #13727

The approach is to add non-functional cli contributions for any
arguments that concern only the electron-main process.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Add WindowState active in plugin API (#13718)

fixes #13692

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* [vscode] Update DropMetadata and DocumentPaste to 1.89 version (#13733)

Update DropMetadata and DocumentPaste to 1.89 version

fixes #13694

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* chore: add cross-env dependency to examples/playwright (#13634)

This allows running the Playwright tests in Windows.

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>

* Fixed focus loss of the notebook editor widget when a cell editor was unfocused (#13741)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Dev container improvements (#13714)

* basics for preferences, remoteUser and Post Create Command

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* setting preferences from command line when starting theia

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* implemented more devcontainer properties:
PostCreateCommand, RemoteUser, sttings and extensions

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* more lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* modify /etc/profile if possible to not have it overwrite the path when launching a terminal

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed stopping containers on conenction dispose

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* added displaying of default forwarded ports by the container

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* more lint because my local eslint is not working

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* dynamic forwarded ports from devcontainer.json

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* more lint

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Fix quick pick separators from plugins (#13740)

* Bump API version to 1.89.1 (#13738)

fixes #13693
Contributed on behalf of STMicroelectronics
Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Notebooks: Aligned scroll into view behaviour with vscode (#13742)

* Fixed focus loss of the notebook editor widget when a cell editor was unfocused

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* aligned the scroll into view behaviour with vscode

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* inserting new cell scrolls

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed delete still scrolling

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* dont scroll into cell when click into text

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Improve VSCode tab API (#13730)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* fix notebook cell divider size (#13745)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Fix performance issues in terminal (#13735)

Do not search for matches in the workspace when creating links in the
terminal, as this impacts performance in large workspaces. Instead,
search for a match only when the user wants to open a link. If the match
can't be found, open the quick input service and let the user select
from a list of possible matches.

Additionally, the LocalFileLinkProvider no longer matches single words,
to avoid polluting the terminal with links.

Contributed on behalf of STMicroelectronics

* Fix an API test failure on macOS (#13732)

Before this fix, Monaco API KeybindingService.resolveKeybinding test was failing
on macOS with

```
AssertionError: expected { label: '⌃⇧⌥⌘K', …(6) } to deeply equal { label: '⌃⇧⌥⌘K', …(7) }
+ expected - actual

{
 "WYSIWYG": true
 "ariaLabel": "⌃⇧⌥⌘K"
+  "chord": false
 "dispatchParts": [
   "ctrl+shift+alt+meta+K"
 ]
 "electronAccelerator": "Ctrl+Shift+Alt+Cmd+K"
```

The `chord: false` was removed from the expected object for other platforms
as part of #13217.

This fix removes it from the expected object for macOS.

* Update nls metadata for VSCode API 1.89.0 (#13743)

* Improve dev-container label

Change-Id: I1bb27d0caea9f8a72bbdc2fa5a8dc7ee13bd807b

* Translation update for version 1.50.0 (#13749)

* core: update re-exports for 1.50.0

* v1.50.0

* docs: updated changelog for 1.50.0

Contributed on behalf of STMicroelectronics

* Fix overflow behavior of sidebars (#13483)

* Fix overflow behavior of sidebars

- Ensure that last visible element also gets added to `...` overflow menu if there is not enough space
- Remove special behavior for only one overflowing element
  -  This behavior would always add a second element to the `overflow` menu if only one element is currently overflowing. This did not work for the case where only two tabs where open in the first place. In addition, it unnecessarily hide a tab in some cases even if there was enough space to render it.
- Extract logic to compute and hide hidden tabs into `hideOverflowingTabs` method
- Invoke this method from `computeOverflowingTabsData`. At this point the actual tabs bar is already
  rendered so we can use the actual position/height information to compute overflowing tabs instead
  of manually composing the available height with the hidden tabs bar in `updateTabs`
- Update `AdditionalViewsMenuWidget` to use a dedicated menu path for each side.  This ensures that
  only the hidden tabs of the corresponding sidebar are displayed when clicking the '...' button

Fixes #13482

Contributed on behalf of STMicroelectronics

* fix editors theme change and widget not attached error (#13757)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Improved Upload Command (#13775)

- if nothing is selected uploads to the workspace root
- if a folder is selected uploads to that folder
- if a file is selected uploads to the parent folder

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Stop moving to next cell when suggestion widget is visible (#13774)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Improved ability to overwrite notebook services (#13776)

* improved ability to overwrite notebook services
private fields and methods to protected

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* more private to protected

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Added notebook output options and tag preference search (#13773)

* Added notebook output options and the ability to search for tags in settings

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* review changes

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* review fixes

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* improved tag search

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed line height when set to 0

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Update jsdiff(#13787)

Fixes #13772

contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix type definition of `TheiaAppFactory` (#13799)

Ensure that the `TheiaAppFactory` type does  match the constructor function of TheiaApp.
`InitialWorkspace` is required in the TheiaApp constructor butwas optional in `TheiaAppFactory`
This ensures that (sub)classes of TheiaApp can properly be used as app factory without type casting

Contributed on behalf of STMicroelectronics

* Improved notebook cell drag images (#13791)

* IMproved notebook cell drag images

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* review improvements

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed small issue where the drag over indicator stayed when dropping outside of the notebook editor

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* remove triple backticks from code block

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Fix code escaping

* Optimize algorithm

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Fix programmatic save for custom editors (#13684)

* fix: load correct messaging module in browser-only (#13827)

The frontend generator erroneously included the Electron messaging
module instead of the browser messaging module. Consequently, the
browser-only environment attempted to establish a WebSocket connection
to the backend. This issue has now been resolved.

Fixes #13820

* set notebook editor as active when opening in foreground (#13828)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* wip (#13810)

Send notification with a Promise to respect order between requests and notifications
Test run profile constructor updates observable properties that send a notification to the main test run profile, without main being told to create this profile.  This leads to a profile not found issue when activating the test extension.

fixes #13811

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Always resolve existing before showing new notification (#13668)

* Propagate "Save As" operation to plugin host (#13689)

* improved shown keybindings in context menu (#13830)

* improved shown keybindings in context menu

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* small performance improvement

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Serialize saveables to disk for "Save As" (#13833)

* Fix tab group API event order (#13812)

* Disable cell editor search widget (#13836)

* Fix account menu order, icon and badge (#13771)

* Return empty appRoot in web plugin host (#13762)

* Support `PluginExt#extensionKind` properly (#13763)

* Use `openWithSystemApp` to open uri on `vscode.env.openExternal`(#13676)

* Support dynamic menu contributions (#13720)

* Use `targetPlatform` when installing plugin from open-vsx (#13825)

* [vscode] Stub Chat and Language Model API (#13778)

Stub Chat and Language Model API

fixes #13756

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Fix data race in problem view tree (#13841)

* Switch single instance on per default. (#13831)

Fixes #10890

Also implements VS Code-like behavior when opening second instances

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Add an indicator for loading notebooks (#13843)

* Update doc comments on service-connection-provider.ts (#13805)

Add some documentation to make the usage of the local/remote service id's more understandable.

contributed on behalf of STMicroelectronics

* Block local navigation and open new windows externally in electron (#13782)

Fixes #13592

Allow to open https/http links externally and ask the user for all other
protocols.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Avoid changing context key view when changing selection (#13768)

fixes #13375

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Translation update for version 1.51.0

* [vscode] Stub DebugThread and DebugStackFrame (#13847)

fixes #13758

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* [vscode] Support TestRunRequest.preserveFocus (#13839)

Add a progress service for tests to support activation of views
Forward Test Run to be started event to progress service to activate view if needed

fixes #13759

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Bump API version to 1.90.2 (#13849)

fixes eclipse-theia#13770
Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Improve implementation around widget management (#13818)

Mainly, ensures that any widget promises returned by the `WidgetManager`
will only resolve when the entire widget creation process has completed
successfully, including the 'onWillCreateWidget` part.

* v1.51.0

* core: update re-exports for 1.51.0

* docs: updated changelog for 1.51.0

Contributed on behalf of STMicroelectronics

* Codicon color and URI support for TerminalOptions (#13413)

Co-authored-by: FernandoAscencio <fernando.ascencio.cama@ericsson.com>
Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Refactor trademark section for better readability (#13866)

* Add support for 256 truecolor (#13853)

Beforehand the `terminfo[colors]` and `COLORTERM` were not set properly.
The terminal already supports 256 truecolor, but cli tools might not use it, as the env variables were not set correctly.
This is fixed with this PR, the color is not set to `256` and `COLORTERM` is set to `truecolor`.

Fixes #13523.

* Refactor preference tree layouting (#13819)

* Use relative paths for ctx.importScripts() (#13854)

Before we tried to load absolute paths e.g. `/context/`.
This is a problem, when working in deployed use cases, where Theia might be hosted under a path (e.g. try.theia-cloud.io).
Because then the loaded path will be from the root of the page and not, like wanted, from the current path.
Simply changing it to relative paths (e.g. `./context/`) solves this issue.

Fixes #13813

* Add breaking change entry for `OpenWithService` (#13893)

* fixed reload for remote feature and added option to the electron handler to add change url (#13891)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Fix FileResource not adding event listener to the disposable collection (#13880)

Signed-off-by: Vivien Jovet <vivien.jovet@torocloud.com>
Co-authored-by: Vivien Jovet <vivien.jovet@torocloud.com>

* Update Mac OS version to 14 in CI (#13908)

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Stub proposed APIs used by Python debugger (#13894)

* Fix plugin version comparison (#13907)

* Add logging to `download:plugins` script (#13905)

Attempted mitigation for #13902 

- do not eat exceptions and properly log errors
- reduces request rate to 3/sec.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Make sure UI loads when minimized. (#13887)

Fixes #13798

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Update dead/broken README links (#13931)

Signed-off-by: Danielle De Leo <danielle@fastmail.net>

* Make Notebook preferences registration substitutable (#13926)

Implement the commonly employed pattern for preference contribution
registration to enable substitution of the Notebook preference schema.

Fixes #13913

Signed-off-by: Christian W. Damus <cdamus.ext@eclipsesource.com>

* change cell type when selecting markdown as  a code cells language (#13933)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Fix python version doc (#13928)

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Co-authored-by: Johannes Faltermeier <jfaltermeier@eclipsesource.com>

* Introduce environment variable to override connexion settings (#13936)

fixes #13800

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>

* tab selected should be adjacent when closing last one. (#13912)

fixes #13886

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* upgrade ws to 8.17.1 and jsdom to 24.1.0 (#13903)

fixes #13848

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Bug fix: "core.saveAll" command shall only save dirty widgets (#13942)

* Prevent tooltip if no caption is provided and add caption for settings (#13945)

* [vscode] Implement stubbed API for activeStackFrame API (#13900)

fixes #13846

contributed on behalf of STMicroelectronics

* Add border and fix indentation for editable markdown cell (#13947)

* Translation update for version 1.52.0 (#13953)

Co-authored-by: sgraband <sgraband@eclipsesource.com>

* Add DebugSessionOptions.testRun (#13939)

Fixes #13872

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* [chore] downgrade jsdom to 22.1.0 (#13944)

fixes #13943

* Bump API version to 1.91.1 (#13955)

fixes #13954
Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* docs: updated changelog for 1.52.0

* core: update re-exports for 1.52.0

* v1.52.0

* Fix flaky playwright Theia Main Menu test

We are observing cases where the `.getByRole('button', { name: 'OK' })` resolved to multiple elements (e.g. [here](https://github.com/eclipse-theia/theia/actions/runs/10025491100)).

With this change we limit the selection to the dialog shell and hopefully remove this ambiguity.

Contributed on behalf of STMicroelectronics.

Change-Id: I5ee5b3fc6a683f68da99e219b32784c3f5d4bfb7

* Support find widget in notebooks (#13982)

* Use correct cell type for selected language (#13983)

* Support for "--headless-hosted-plugin-inspect" cmd argument  (#13918)

* introduce getServerName method on backend 
* add preferences to specify node js debug ports per hosted plugin server
* adjust PluginDebugConfiguration to also accept and array of server-name to debug port entries

* Refactor undo-redo action for editors (#13963)

* Fix notebook output scrolling and text rendering (#14016)

* Notebook: Support for Alt+Enter keybinding (#14022)

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Actually create notebook model on `openNotebookDocument` (#14029)

* Don't use ChannelMultiplexer in RPCProtocol (#13980)

Fixes #13960

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix 429 errors on OVSX requests (#14030)

* Add aliases for `list.focusUp` and `list.focusDown` for notebooks (#14042)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Drop support for Node 16.x (#14027)

Fixes #13956

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Add notebook selected cell status bar item and center selected cell command (#14046)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Rely on IConfigurationService change event to update model options (#13994)

Fixes #13920, #13929

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Update electron to version 30.1.2 (#14041)

Fixes #14014

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Allow opening changes for files associated with custom editors (#13916)

* Fix loading of webview resources that depend on query params

Some resource url (notably git) use the query part of the url to store
additional information. The query part of the url was incorrectly being
dropped while attempting to load these resources inside of webviews.

See also https://github.com/microsoft/vscode/commit/48387dfc3d691558404cff1ea2582e3862a40080

* Fix `Error: Unknown Webview` messages in the log

* Fix design and implementation issues surrounding `CustomEditorOpener`

This commit ensures that the promise returned by `CustomEditorOpener.open`
will only resolve to a properly initialized and opened `CustomEditorWidget`.
In particular, it ensures that the widget is opened according to the specified
`WidgetOpenerOptions`, including `widgetOptions.ref` and `mode`.

Essentially, it revises the work done in #9671 and #10580
to fix #9670 and #10583.

* Restore custom editors as part of layout

Fixes an incorrect assumption that a custom editor cannot be restored
if no `WebviewPanelSerializer` is registered for its view type. (Actually,
custom editors are created and restored using a custom editor provider.)

Also, ensures that `CustomEditorWidget.modelRef` satisfies the shape for the
`CustomEditorWidget` defined in `editor.ts` and cannot return `undefined`.
(However, `CustomEditorWidget.modelRef.object` can be `undefined`
until the custom editor is resolved.)

Fixes #10787

* Fix a race condition when file system provider is activated

When file system provider is activated, wait until it is registered.

* git: add support for custom editors

* Uses `OpenerService` instead of `EditorManager` to open editors

* Contributes a `FileSystemProvider` for git-resources

* Fixes an issue with getting blob contents

* custom editor: open a diff-uri in a side-by-side editor

`CustomEditorOpener` is now able to open a diff-uri in a side-by-side editor,
which contains the corresponding `CustomEditor`s.

Fixes #9079

* Fix preference tree for plugins (#14036)

* Stub Terminal Shell Integration VS Code API (#14058)

* Correctly revert saveable on widget close (#14062)

* Creating a new untitled notebook doesn't work (#14031)

* Download json schema catalog at build-time instead of run-time (#14065)

Fixes #11881

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Add support for reverting a composite saveable (#14079)

* Support the menu contribution point "testing/profiles/context"

fixes #14013

contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Co-authored-by: Thomas Mäder <t.s.maeder@gmail.com>

* Bump API version to 1.92.2 (#14076)

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Implement stubbed window#registerURIhandler (#13306)

fixes #13169

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Enhance notebook cell divider (#14081)

* Support collaboration feature (#13309)

* Align available locales to VS Code (#14039)

* Translation update for version 1.53.0 (#14089)

Co-authored-by: jfaltermeier <jfaltermeier@eclipsesource.com>

* Support notebook selection VS Code API (#14087)

* Add 3 vscode command implementations (#14093)

* Produce failure on translation error (#14092)

* docs: updated changelog for 1.53.0

Contributed on behalf of STMicroelectronics

* core: update re-exports for 1.53.0

Contributed on behalf of STMicroelectronics

* v1.53.0

* Remove the timeout handler when an request is handled. (#14118)

Fixes #14117

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix FileResource sometimes sending contents change (#14043)

Add a lock to the write operation so that checking
if the file is synced must wait for the write
operation to be done.

Fixes #14021

Contributed on behalf of Toro Cloud

Signed-off-by: Vivien Jovet <vivien.jovet@torocloud.com>

* Support proxy env variables for schema catalog download (#14130)

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Fix selection of contributed menu action argument adapters (#14132)

Fixes #14072

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>om>

* Theia AI LLM Support [Experimental]

    Implements AI LLM support via optionally consumable Theia extensions.

    The base functionality is provided by the following extensions:
    - @theia/ai-core
    - @theia/ai-chat
    - @theia/ai-chat-ui

    'ai-core' contains the basic LLM integration and defines the core
    concepts for interacting with LLM via agents, prompts and variables.
    'ai-chat' builts on top to define a model for chat like conversations.
    'ai-chat-ui' provides the actual Chat UI.

    The AI integration was built from the ground up to be flexible,
    inspectible, customizable and configurable.

    This feature is still highly experimental. Therefore, even when the AI
    extensions are included in a Theia based application, they are turned
    off by default and need to be enabled in the preferences. The
    preferences include a convenient "Turn all AI features on/off" setting.

    Additional features and integrations are offered by the remaining
    extensions:
    - @theia/ai-history
    - @theia/ai-code-completion
    - @theia/ai-terminal
    - @theia/ai-workspace-agent
    - @theia/ai-openai

    'ai-history' offers a service to record requests and responses. The
    recordings can be inspected via the 'AI History View'.
    'ai-code-completion' offers AI based code completion via completion
    items and inline suggestions.
    'ai-terminal' offers a specialized AI for the Theia terminal which
    will suggest commands to execute.
    'ai-workspace-agent' is a specialized agent which is able to inspect
    the current workspace content for context specific questions.
    'ai-openai' integrates the LLM offerings of Open AI into Theia.

    Co-authored-by: Alexandra Muntean <amuntean@eclipsesource.com>
    Co-authored-by: Camille Letavernier <cletavernier@eclipsesource.com>
    Co-authored-by: Christian W. Damus <cdamus.ext@eclipsesource.com>
    Co-authored-by: Eugen Neufeld <neufeld.eugen@googlemail.com>
    Co-authored-by: Haydar Metin <hmetin@eclipsesource.com>
    Co-authored-by: Johannes Faltermeier <jfaltermeier@eclipsesource.com>
    Co-authored-by: Jonas Helming <jhelming@eclipsesource.com>
    Co-authored-by: Lucas Koehler <lkoehler@eclipsesource.com>
    Co-authored-by: Martin Fleck <mfleck@eclipsesource.com>
    Co-authored-by: Maximilian Koegel <mkoegel@eclipsesource.com>
    Co-authored-by: Nina Doschek <ndoschek@eclipsesource.com>
    Co-authored-by: Olaf Lessenich <olessenich@eclipsesource.com>
    Co-authored-by: Philip Langer <planger@eclipsesource.com>
    Co-authored-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
    Co-authored-by: Simon Graband <sgraband@eclipsesource.com>
    Co-authored-by: Tobias Ortmayr <tortmayr@eclipsesource.com>

* feat: Ollama integration for Theia AI

Integrates Ollama language models into Theia via the new 'ai-ollama'
package. The endpoint and models can be configured via the preferences.

* ai: Improve prompt of workspace agent (#14159)

Fixes #14128

Extend the prompt of the Theia AI workspace agent to get better answers
and get the agent to base the answers on the actual workspace contents
instead of assuming general workspace and file contents.

* Add handling of multiple accounts to authentication api (#14149)

* Adds handling of multiple accounts to authentication api

Fixes #14110

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Consistent prompt ids (#14162)

fixed #14161

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Adapt default LLM for Theia AI to gpt-4o (#14165)

Add gpt-4o-2024-05-13 as an option

fixed #14164

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* fix: integrate AI preferencex context key

The ai-core package offers a preference context key, which can be used
in scenarios like 'when' clauses for menus. This key was not integrated,
leading to the deactivation of all dependent features. This is now fixed.

* Support `workbench.editorAssociations` preference (#14139)

* Move TerminalShellIntegration stubs to main theia API (#14168)

fixes #14107

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Remove stub tag from `TerminalOptions#color` (#14171)

* Focus notebook cell container correctly (#14175)

* Consitently name agents and add tags (#14182)

* Consitently name agents and add tags

fixed #14180

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Properly support `executeDocumentSymbolProvider` command (#14173)

* Fix notebook context selection (#14179)

* Expand plugin preferences on scroll correctly (#14170)

* feat: support models served via Open AI API (#14172)

* feat: support models served via Open AI API

The Open AI settings now allow to configure additional models and their
associated endpoints. This can be used to integrate any custom model
running locally or in the Cloud as long as it supports the Open AI API.

Co-authored-by: Philip Langer <planger@eclipsesource.com>

* fix: disabling an agent also disables its UIContribution (#14184)

- agent service had a loop so that a single instance was not created
- code completion agents now check whether they are active
- terminal agent now check whether it is active
- chat-service correctly handles no available agents now

fixes #14167

* Handle only user workspace trust settings (#14147)

* Leak fix, use same signature in disconnect (#14186)

The disconnect from the signal was not passing the this reference
as it was used in the connect, hence the disconnect failed to find
the handler.

* Makes the cell editor border grey when not focused (#14195)

* chore: polish AI code completion

- removes code completion item provider as it blocks the completion
  popup
- reworks the code completion prompt so that it can be easier
  customized
- catches abort errors in the Open AI Api which are triggered very
  often when using code completion. This avoids spamming the log with
  "non-errors".

* Refine Experimental Message for AI Features (#14187)

* Refine Experimental Message for AI Features

fixed #14185

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Refine AI settings (#14202)

* Refine AI settings

fixed #14201

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Aligned active text and notebook editor more towards vscode (#14190)

* active notebook editor now undefined when a text editor is selected

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* working vscode api active text editor for cells

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed backend focused cell when creating new

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed notebook and text editors side by side not being set as active correctly

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* feat: show variables and function on ai agent configuration (#14177)

* feat: show variables and function on ai agent configuration

The agent configuration now shows also the variables (global and agent specific) as well as the functions that the agents uses.
If a variable or function is used in the prompt but is not declared by
the agent then this is also marked in the view.

All agents are updated to declare the variables and functions they use.

fixes #14133

* fix missing emit on propmt template folder switch

* Add enable state of agent to preferences (#14206)

* Add enable state of agent to preferences

The selected model was already persisted in the preferences,
but the enablement state was not.
Here the settings were extended to include the enablement state.
The new setting is consumed and updated from the AgentService.

Fixes #14205

* chore: align with ai-features preferences

* feat(ai): Add toolbar actions for chat nodes (#14181)

Introduces a `ChatNodeToolbarActionContribution` which allows to add icons to the chat nodes in the Chat UI on hover. Clicking these icons will trigger a command that gets the respective chat node as argument.

Possible use cases are actions for reporting the content, giving feedback, or perform other actions within the tool based on the response.

Contributed on behalf of STMicroelectronics.

Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>

* Support evolution on proposed API extensionAny (#14199)

fixes #14115

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* Support TestMessageStackFrame API (#14154)

Support TestMessageStackFrame API

fixes #14111

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* [vscode] TreeView reveal options are now readonly (#14198)

fixes #14109

Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>

* remove type duplication for kind property (#14207)

* fix ai-settings retrieval (#14221)

The languageModelRequirements can be undefined and
this needs to be correcly handled by callers.

* Update default API version to 1.93.1 (#14224)

Fixes #14116

Contributed on behalf of ST Microelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Translation update for version 1.54.0

* docs: update changelog for 1.54.0

* core: update re-exports for 1.54.0

* v1.54.0

* Fix incorrect import in `split-widget.ts` (#14232)

`Emitter` was incorrectly imported from 'vscode-languageserver-protocol'
instead of 'common'.

* fix notebook editor focusing (#14229)

* fix notebook editor focusing

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* added tabindex to loading editor

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fix: render html text in Theia AI markdown renderers

Adapt rendering of all Theia AI markdown renderers to use markdown-it directly.

The MarkdownRenderer exposed by Theia automatically strips html tags while we still want
to show them as text in requests and responses. The html is not interpreted and therefore
can't be used for injections.

fixes #14208

* Fix duplicate text editor entry (#14238)

* feat(ai): Make response parsing extensible (#14196)

Turns the response parsing method into a more flexible algorithm
that can work with multiple response content matchers. Each response
content matcher has a start and end regexp to define a match, as well
as a `contentFactory` function that turns the matched content into a
`ChatResponseContent` object.

Additionally, the parsing method has a fallback content factory that
will be applied to all unmatched parts, e.g. markdown by default.

Both, the response content matchers and the fallback content factory
and the list of matchers are extensible via DI.

Contributed on behalf of STMicroelectronics.

* Improve widget specific status bar handling (#14239)

* [Theia AI] Terminal agent records its requests (#14246)

* Terminal agent records its requests

fixed #14245

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* feat(ai): Update OpenAI models supporting structured output

* Wrap api objects returned to clients in a proxy (#14213)

Fixes #13522

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Fix css calc expression to have space around operator (#14241)

Fixes #14204

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Update Plugin-API.md (#14254)

Fixed the "RCP" typo to "RPC"

* Replace `nsfw` with `@parcel/watcher` (#14194)

* Ensure notebook document event registration (#14242)

* fixed notebook editor staying current until another editor is selected (#14262)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Notebook webview output optimization (#14234)

* basic single backlayer webview

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* allow interacting with outputs

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* output presentation change and more smaller improvements

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* output height fixes

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* output height calculation

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* collapsing outputs

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed ouptut presentation change

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* removed testing console logs

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed interacting with cells regardless of position focusing it

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed some errors when closing a notebook

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* improved renderer failing

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed issue with cell height changes

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fixed outputs when reopening  notebook editors

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* fix iframe height

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Notebook: Split cell command implementation (#14212)

* Pin Ubuntu CI versions to 22.04 (#14275)

* Update rimraf to 5 (#14273)

* Update rimraf to 5

fixed #14272

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Playwright API for Notebooks (#14098)

* Allow to order and clear AI History view (#14233)

* Allow to order and clear AI History view

fixed #14183

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Orchestrator logs its own requests (#14255)

* Orchestrator logs its own requests

- add data field to request
- add option to turn off default logging
- extracted getJsonOfText
- add docu for getTextOfResponse

fixed #14252

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Optimize showing recent workspaces (#14260)

* Notebook Cell Tag Support (#14271)

* added cell tag and status bar item support for notebooks

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* Start menu handler ids at one, not zero (#14282)

Fixes #14279

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* blur cell on shift+enter, only update cell height when changed (#14277)

* fix cell focus on shift+enter, only update cell height when changed

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* feat(ai): Allow customizing the LLM request settings

With this change, we enable more easily customizing the LLM settings, such as `temperature`, for the LLM requests in a chat agent.

Contributed on behalf of STMicroelectronics

* feat(ai): Improve styling of the chat widget

* General improvements of margins and paddings
* Give code a nicer border and more space
* Replace aggressive buttons for code parts with more subtle icons
* Format tool call result more nicely

Contributed on behalf of STMicroelectronics

* Add support for proposed signature for workspace.createFileSystemWatcher (#14303)

Fixes #13957

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Upgrade puppeteer to 23.1.0. (#14261)

Fixes #14141

Newer versions have an issue with headless mode.
Also fixes test flakiness with the new version.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Upgrade express to 4.21.0 (#14283)

Fixes #14258, #14259

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* Add preference to exclude files from AI code completion (#14315)

Adds the preference 'ai-features.codeCompletion.excludedFileExtensions'
to filter code completion requests before they are delegated to the
AICodeInlineCompletionsProvider.

fixed #14313

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

* Set menu bar less often at startup (#14295)

Fixes #14280

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

* feat: add support for llamafile as ai model provider (#14281)

Support llm execution via llamafiles.

- The configured llamafiles are stored in the preferences
- As a user you have to provide:
  - a custom modelname
  - the file uri to the llamafile
  - the port to run the llama.cpp server on
- Llamafiles can be started and stopped via Theia commands
- The llamafile output is send to a new output channel <mymodel>-llamafile

The current implementation does not support tools/functions so that
agents like the workspace-agent don't work well with models provided
via llamafiles.

fixes #14286

* Fix: use @theia/ai-core package in import

Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>

* fix onDidChangeActiveNotebookEditorEmitter to fire correctly when editor changed (#14321)

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* feat: support custom keys for custom Open AI models

The configuration for custom OpenAI models now allows specifying a
unique 'apiKey' for each model, or reusing the global OpenAI API key.

fixes #14288

* feat: add support for custom agents (#14301)

This adds support for custom agents which are basically a custom
system prompt with additional metadata (id, name and description).
This features allows to add very specific agents without coding.
All features, like variable and functions are supported.

* Notebook: Escaping code completion pop-up disables cell edit mode (#14328)

* Notebook: Escaping code completion pop-up disables cell edit mode

* Added some more tests

* Show error message when uploading fails (#14349)

* Accept a string argument in env.openExternal API (#14350)

Fixes #14335

contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>

---------

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Signed-off-by: Leo Zhu <yifu.zhu@microchip.com>
Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>
Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
Signed-off-by: Vivien Jovet <vivien.jovet@torocloud.com>
Signed-off-by: Danielle De Leo <danielle@fastmail.net>
Signed-off-by: Christian W. Damus <cdamus.ext@eclipsesource.com>
Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>om>
Co-authored-by: Remi Schnekenburger <rschnekenbu@users.noreply.github.com>
Co-authored-by: Jonah Iden <jonah.iden@typefox.io>
Co-authored-by: Thomas Mäder <tsmaeder@users.noreply.github.com>
Co-authored-by: Mark Sujew <mark.sujew@typefox.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jfaltermeier <jfaltermeier@eclipsesource.com>
Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
Co-authored-by: Vladimir Piskarev <pisv@1c.ru>
Co-authored-by: Maddobun <76917395+Maddobun@users.noreply.github.com>
Co-authored-by: Dennis Huebner <dennis.huebner@gmail.com>
Co-authored-by: Olaf Lessenich <olessenich@eclipsesource.com>
Co-authored-by: Jonas Helming <jhelming@eclipsesource.com>
Co-authored-by: Thomas Mäder <t.s.maeder@gmail.com>
Co-authored-by: Simon Graband <sgraband@eclipsesource.com>
Co-authored-by: Eugen Neufeld <eneufeld@eclipsesource.com>
Co-authored-by: Eric <76749688+eric-sclafani@users.noreply.github.com>
Co-authored-by: Alexandra Buzila <abuzila@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Tobias Ortmayr <tortmayr@eclipsesource.com>
Co-authored-by: FernandoAscencio <fernando.ascencio.cama@ericsson.com>
Co-authored-by: rifat87 <102798983+rifat87@users.noreply.github.com>
Co-authored-by: Hanksha <vivien.jovet@gmail.com>
Co-authored-by: Vivien Jovet <vivien.jovet@torocloud.com>
Co-authored-by: Dani De Leo <danielle@fastmail.net>
Co-authored-by: Christian W. Damus <cdamus.ext@eclipsesource.com>
Co-authored-by: Chris Radke <c.radke@posteo.de>
Co-authored-by: Haydar Metin <hmetin@eclipsesource.com>
Co-authored-by: pchuong <1699061+pchuong@users.noreply.github.com>
Co-authored-by: Lucas Koehler <lkoehler@eclipsesource.com>
Co-authored-by: dfriederich <109323095+dfriederich@users.noreply.github.com>
Co-authored-by: eyyyyyyy3 <64200003+eyyyyyyy3@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants