Repository navigation
Keep the Riverbank layout in narrow desktop windows - #10
Merged
Merged
Conversation
A desktop window no longer falls back to the phone's compact layout. Below the width that holds the notes list beside the page, it keeps the rail and the page, and the list opens over the page instead: flush against the rail, with the page dimmed behind it, until a note is chosen or created, Escape is pressed, or the page is clicked. One method, _setListShown, decides between beside and over, and every control goes through it: the shortcut, the toolbar's button, the list's hide button and divider, a trackpad swipe, an empty pane and Find notes. A list open over the page moves beside it once the window widens. The window's minimum grows to 520x520, tall enough for the rail with every space, the streak and the account on it. What only a narrow desktop window used goes with it: the toolbar's traffic-light inset, the drawer's edge drag, its Hidden Notes row and shortcut hint, and the compact editor's desktop results divider. Tests of the phone's layout now run as a phone.
The narrow window's goldens now show the rail and the page, with the list hidden and with it open over the page, where the compact golden showed the phone's layout. The shared-note toolbar goldens lose the traffic-light inset.
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.
Narrow macOS and Windows windows keep the Riverbank layout instead of falling back to the phone's (HIS-16). This is stacked on #9, which is stacked on #8 and #7. The editor page (HIS-10) stacks on this branch.
The default window is 600×720 and the two-pane breakpoint is 720, so until now a fresh desktop launch opened in the phone layout. A desktop window now never builds the compact layout. Phones and tablets still use it below 720, and their goldens don't move.
These are the goldens: widget-test renders at 600pt wide, not captures of a running build. The bright line in the first two is the results divider under the pointer, which is what those two goldens test.
The list over the page
Below 720, the window keeps the rail and the page, and the page keeps its 12pt margin from the rail, as in Paper's window with the list hidden. Showing the list opens it over the page, flush against the rail, with the page dimmed behind it by the palette's scrim. It closes when a note is chosen, opened to the side or created, on Escape, on a click on the page, and from its own hide button. The page keeps its place and width underneath, so nothing reflows.
Resizing moves between the two. A list open over the page stands beside it once the window has room, and a list beside the page folds away when the window narrows and comes back when it widens.
SplitViewtakes anoverlayflag for this. Over the page, it draws the list above aModalBarrier(sidebar-overlay-barrier) and leaves at least 48pt of the page in view to click. Beside the page, the page still keeps at least 320pt. The list now slides open and shut only beside the page: when the room for it comes or goes, it appears or disappears at once. That fixes the page's wordmark overflowing for a few frames when a window jumped from wide to narrow.One way to show and hide the list
_setListShown(bool)inhome_page.dartdecides between beside and over, and_toggleList()and_dismissListOverlay()go through it. Every control uses it: the shortcut, the toolbar's show-list button, the list header's hide button, the divider, a trackpad swipe, the empty state's Show notes, and Find notes. Beside the page it still setsLayoutPrefs.sidebarVisible. Over the page it is session state, so opening the list in a narrow window doesn't change what a wide one shows. The Notes list setting ("Show the notes list beside your editor") keeps its meaning, andsettings_dialog.dartis untouched to stay clear of #8.For HIS-10: the editor page's show-list button should call
_toggleList.NoteToolbar.atWindowLeftEdgeis gone, so the new toolbar doesn't need to keep it.Minimum window size
The minimum grows from 520×360 to 520×520, so the rail fits with every space, the streak, Settings and the account on it. A new test renders that rail at the minimum height on macOS, and on Windows less the 40pt its caption and frame take, and checks that nothing overflows.
MainFlutterWindow.swiftand the Windows runner are untouched.Removed
With no narrow desktop layout left, these go:
NoteToolbar.atWindowLeftEdgeand its traffic-light inset, withWindowChrome.leadingInsetandtopInset. Only a narrow macOS window put the toolbar under the traffic lights. The rail now always takes them._toggleCompactSidebarFromTrackpad, and the compact list's desktop-only Hidden Notes row and shortcut hint (showHiddenFolder,hiddenShortcut,_FolderShortcutHint). The phone drawer opens as before, throughMobilePageSwipe.Testing
~/dev/flutterwithflutter pub get --enforce-lockfile, because the 3.47.2 install on the build Mac is damaged.flutter analyze: no issues.flutter test: 2116 passed, 8 skipped, on top of Build the notes list beside the rail as Riverbank's cards #9's head (2d7b716).app_test.darthas a newnarrow windowgroup. It checks that the default window keeps the rail and the page. It also checks that the list opens over the page and closes on a click, on Escape, from its hide button, on a chosen note (which opens ready to type) and on a new note, without touching the wide window's setting. Another test resizes a window across 720 and back with the list open. The tests that drove the compact drawer in a narrow desktop window (the notes shortcut, Find notes, the search row, the results divider) now drive the list over the page.spaces_rail_test.dart: the rail fits the smallest macOS and Windows windows with every space.welcome_note_test.dart's phone test now runs as iOS, andtoolbar_test.dartdrops the traffic-light test.desktop_dark_narrow_results_divider_hover.pngreplacesdesktop_dark_compact_results_divider_hover.png.desktop_dark_narrow_list.pngis new: the list open over the page.toolbar_shared_note_dark.pngandtoolbar_shared_note_light.png: the menu and avatars start 9pt from the bar's edge instead of after the traffic lights.Not verified: I didn't launch the app or resize a real window, because this thread has no screen capture on the build Mac. CI builds the desktop apps.