fix: hidden sidebars slide off-screen and take no input - #594
Open
maccavelli wants to merge 1 commit into
Open
maccavelli wants to merge 1 commit into
maccavelli wants to merge 1 commit into
Conversation
- start sidebar now slides off leading edge (was left at x=0) - wrap both sidebars in IgnorePointer/ExcludeFocus/ExcludeSemantics when hidden - update tests for breakpoint, toggle, drag-close, and focus traversal - bump to 2.2.4 # AI-generated (4 files: +501 -163) # YAML: 1, Other: 3
Author
This branch has not been deployed
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.




Fixes #593.
A hidden start
Sidebarstayed at the window's leading edge beneath the content, still painted,hit-testable, focusable and in the semantics tree. It showed wherever the content paints no
background. A hidden end
Sidebarslid off-screen, but could still take keyboard focus.What changes (
lib/src/layout/window.dartonly; no public API change):AnimatedPositionedgetsleft: visibleSidebarWidth - _sidebarWidth, sohiding slides it off the leading edge, animated with the content, as the end sidebar does.
IgnorePointer,ExcludeFocusandExcludeSemantics, keyed on!canShowSidebarand!canShowEndSidebar. At rest, off-screenplus the
Stackclip already keeps a sidebar out of hit testing and semantics. The wrappersalso cover the 300 ms toggle slide, while it is still partly visible. For focus, they are the
only thing that keeps a hidden sidebar out.
Most of the
window.dartdiff is re-indentation under the new wrappers. With whitespacehidden, it is +34 −3.
The native visual-effect view follows without any extra wiring: the toggler's
setStateafterthe slide rebuilds
TransparentMacOSSidebarat its final position, and resizing or draggingrebuilds every frame. This was checked on a device, with and without an explicit
VisualEffectSubviewContainerResizeEventRelay, and the two builds measured the same in all 10captures, so the patch does not add one.
Before / after, toggled off, with the window background transparent and then opaque (the
issue's sample, plus a label naming the build)
In every hidden state, measured on window captures:
When the sidebar is shown again, its material is back behind it.
Tests (
test/layout/window_test.dart, 10 new; the 16 existing ones are unchanged and pass):hit-testable, not focusable, absent from the live semantics tree;
find.semantics.byLabel, which searches the live tree.find.bySemanticsLabelstill reports a node afterExcludeSemanticsstarts excluding it.devwithout the change, each of the 8 hidden-state and mid-slide tests fails, and the 2shown-state controls pass.
left, and each of the three wrappers on each sidebar)fails at least one new test, on the assertion that change is responsible for.
Checked locally with Flutter 3.47.2 (stable), macOS 26.6.2, Xcode 27.0:
flutter analyze --fatal-infos .: no issues.dart format --set-exit-if-changedon the changed files: clean.dcm analyze --fatal-style .(DCM 1.39.2): no issues.flutter test: all pass except 10 failures that are already ondevwithout this change. Theyare the "lerps from dark to light" and "lerps from light to dark" tests in
test/theme/{help_button,icon_button,icon,popup_button,pulldown_button}_theme_test.dart. Tag2.2.2 fails the same 10 on this SDK.
Noticed along the way, and not changed here:
example/does not build with Xcode 27: its deployment target is 10.14.6, and Xcode supports12.0 and later.
dart formatwould also change two files already ondev:lib/src/layout/sidebar/sidebar_items.dartandtest/buttons/pulldown_button_test.dart.Pre-launch Checklist
CHANGELOG.mdwith my changes🤖 Generated with Claude Code
https://claude.ai/code/session_01Qdd4Y9iCLirehsBoNyMp7R