Skip to content

Prevent illegal array size when constructing menu bar#17362

Open
colin-grant-work wants to merge 3 commits intomasterfrom
bugfix/toggle-menu-bar-17352
Open

Prevent illegal array size when constructing menu bar#17362
colin-grant-work wants to merge 3 commits intomasterfrom
bugfix/toggle-menu-bar-17352

Conversation

@colin-grant-work
Copy link
Copy Markdown
Contributor

What it does

Fixes #17352 by overriding the clearMenu method of the dynamic menu bar to reset state tracking fields that go stale otherwise. If the values are stale, Lumino will attempt to construct new Array(-1), leading to an error and a broken menu.

How to test

  1. In the browser... (or, probably, in Electron on Windows or Linux)
  2. Use the View > Appearance > Toggle Menu Bar command two or more times
  3. The menu bar should not be broken at any point.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation Bot moved this to Waiting on reviewers in PR Backlog Apr 16, 2026
@ndoschek ndoschek requested a review from cdamus April 20, 2026 08:33
Copy link
Copy Markdown
Contributor

@cdamus cdamus left a comment

Choose a reason for hiding this comment

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

Looks good to me! I do have a nit to offer.

Comment thread packages/core/src/browser/menu/browser-menu-plugin.ts Outdated
@github-project-automation github-project-automation Bot moved this from Waiting on reviewers to Needs merge in PR Backlog Apr 20, 2026
Copy link
Copy Markdown
Contributor

@cdamus cdamus left a comment

Choose a reason for hiding this comment

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

Works just as well and looks more tasty. Thanks for the update!

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

Labels

None yet

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

Toggle menu bar fails to render menu on second iteration.

2 participants