Skip to content

fix(menu): title-bar menu dialogs open from the title bar's context (#1777) - #1780

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
fix/title-bar-menu-dialog-context
Oct 25, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
fix/title-bar-menu-dialog-context

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Fixes #1777.

Problem

Choosing Edit → Preferences… threw Looking up a deactivated widget's ancestor is unsafe: QueryaMenuItem passes its own context to onPressed, the menu is closed when the dialog opens a frame later, and showAppDialog looks up MaterialLocalizations on that dead element.

Fix

The title bar's items that open a dialog or the palette (Command Palette, Go to Object, Preferences, Extensions, Driver Manager, About, Check for Updates) use the title bar's own build context, which stays mounted. The File items that only invoke an Intent are not changed.

QueryaMenuItem itself is unchanged: other menus (connections panel, ERD, grid) pass the same kind of context to onPressed and may have the same problem; not checked here.

Tests

New widget test taps Edit, then Preferences… with the real pointer path and expects the dialog and no exception. Without the fix it fails with the exact deactivated widget error from the issue.

Run: test/features/main_screen/ (114 tests, all pass), dart analyze on the two files.

…context, not the closed menu item's (#1777)

Preferences, Extensions, Driver Manager, About, Check for Updates, Command
Palette and Go to Object took the menu item's own context. The menu is closed
when the dialog opens a frame later, so the lookup threw "Looking up a
deactivated widget's ancestor is unsafe".
@github-actions github-actions Bot added the bug Something isn't working label Oct 25, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit ba10031 into dev Oct 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant