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

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

Open
xpomul opened this issue Feb 25, 2025 · 1 comment
Assignees
Labels

Comments

@xpomul
Copy link

xpomul commented Feb 25, 2025

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
  • [email protected]
@sdirix
Copy link
Member

sdirix commented Feb 25, 2025

Observations:

  • I can reproduce the issue with Theia 1.58.3 used in a Theia based application
  • I can still reproduce the issue when using prerelease 1.59.0-next.72
  • I can still reproduce the issue when consuming the latest master 3dde0acabee in the Theia based application
  • I can reproduce that only adding the AI packages solves the issue. Adding all Theia packages BUT the AI packages does not solve the issue.
  • I can not reproduce the issue with the example application in the Theia repository, even when removing all AI packages (and sample packages to avoid including the AI packages transitively)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants