Conversation
…l→compact resize Root cause: _OpenNavigationPane's AnimatedContainer shared _panelKey with _CompactNavigationPane. When transitioning from minimal to compact mode, Flutter's GlobalKey mechanism reused the AnimatedContainer state (width=320) causing a spurious 320→50 width animation visible as a brief overlay. Fix: - Add usePanelKey parameter to _OpenNavigationPane (default true) - Pass usePanelKey: false in _buildMinimalView to prevent state reuse - Reset _minimalPaneOpen in _resolveDisplayMode when leaving minimal mode Also: add tests and update CHANGELOG Co-authored-by: bdlukaa <45696119+bdlukaa@users.noreply.github.com> Agent-Logs-Url: https://github.com/bdlukaa/fluent_ui/sessions/a98cf501-1708-4d0d-aa16-0b6a2cc5ec59
Copilot
AI
changed the title
[WIP] Fix wrong transition in auto display mode when resizing screen
fix(NavigationView): prevent spurious overlay flash when auto mode resizes from minimal → compact
Mar 21, 2026
bdlukaa
approved these changes
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
PaneDisplayMode.auto, resizing from minimal (≤640 px) to compact (641–1007 px) briefly shows a full-width pane overlay before the compact pane settles at 50 px.Root cause
_OpenNavigationPaneand_CompactNavigationPaneboth key their internalAnimatedContainerwith the sharedGlobalKey_panelKey. This is intentional for smooth compact ↔ expanded width animations. However, the minimal-mode_OpenNavigationPanestays in the widget tree even when the pane is closed (just positioned off-screen), holdingAnimatedContainerstate at width=320. On transition to compact, Flutter's GlobalKey mechanism moves that element into_CompactNavigationPane, triggering a spurious 320→50 px animation that looks like an overlay flash.Changes
pane.dart– AddusePanelKeyflag to_OpenNavigationPane(defaulttrue). Whenfalse, theAnimatedContaineruseskey: null, cutting the GlobalKey link and letting_CompactNavigationPanestart fresh at the correct width.view.dart– PassusePanelKey: falseto_OpenNavigationPaneinside_buildMinimalView; the minimal overlay never needs to share animation state with the compact pane.view.dart– In_resolveDisplayMode, reset_minimalPaneOpen = falsewhenever the mode transitions away from minimal, so open-pane state doesn't leak into compact mode.test/navigation_view_test.dart– Add two regression tests: one verifying no lingering animation after minimal→compact resize, one verifyingisMinimalPaneOpenis reset on transition.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.