Skip to content

"bad scroll event" occurring in Command Palette in Theia if the application does not include the "@theia/ai-chat-ui" module #15042

@xpomul

Description

@xpomul

Bug Description:

When starting to develop a fresh extension using the yeoman code generator, the default electron-app and browser-app folders each contain a package.json listing a minimum Theia environment as dependencies.

But when I build an run these applications, and in the fresh, empty Theia application, I invoke the Command Palette (using CMD+SHIFT+P), the Command Palette is not cleanly formatted, but looks distorted.
Additionally, on the console, this error is logged:

ERROR Got bad scroll event: {
  inSmoothScrolling: false,
  oldWidth: 0,
  oldScrollWidth: 0,
  oldScrollLeft: 0,
  width: 0,
  scrollWidth: 0,
  scrollLeft: 0,
  oldHeight: 0,
  oldScrollHeight: 0,
  oldScrollTop: 0,
  height: 226,
  scrollHeight: 1980,
  scrollTop: 0,
  widthChanged: false,
  scrollWidthChanged: false,
  scrollLeftChanged: false,
  heightChanged: true,
  scrollHeightChanged: true,
  scrollTopChanged: false
}

I have started to debug this by including the full set of dependencies from Theia IDE and one by one stripping them.
For some reason, the problem seems to be that the "@theia/ai-chat-ui" dependency is missing, because, when I add it to the minimal application, the Command Palette works as expected; but when I remove it again, the Command Palette is distorted again.

Maybe there is an implicit dependency somewhere that causes this? (Or it is a transitive dependency of the ai-chat-ui module ...?).

In any case, the yeoman generator should be fixed to include the necessary dependency (or better yet, if it is really the missing ai-chat-ui module that causes this, I would expect the minimal Theia to even work fine without any AI module installed...).

Steps to Reproduce:

  1. Start in an empty directory and invoke yo theia-extension
  2. Create the HelloWorld extension
  3. Start yarn && yarn build:electron && yarn start:electron
  4. In the launched Theia application, bring up the Command Palette using CMD+SHIFT+P

Additional Information

  • Operating System: MacOS 15.3 (24D60) (M1 Max / arm64)
  • Theia Version: 1.58.3
  • generator-theia-extension@0.1.40

Metadata

Metadata

Assignees

Labels

theia-aiissues related to TheiaAI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions