Repository navigation
feat: open more than one window - #689
Merged
Merged
Conversation
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.
Summary
Each Leafdown process had one window, and
Mod+Qclosed it.File > New window(Mod+Shift+N) now opens another window in the same process, on the welcome screen. Each window has its own tabs, folder context, article navigator, folder search, title, and zoom. Settings and recent items are shared through the persisted stores, which already synchronize every window, so sidebar visibility, status bar visibility, and Always on top apply to every window. With one window, everything behaves as before exceptMod+Q.Save asonto a path another window holds is refused. A rename in the navigator moves the affected tabs in every window, keeping their unsaved changes. A deletion is forwarded to the other windows, because a document watch does not observe a deleted parent folder; their tabs keep their text and showFile missing, with a warning that another Leafdown window deleted the file.Close window(Alt+F4, the close button) asks only about that window's unsaved documents, and closing the last window quits. A window with unsaved documents unminimizes and comes forward before it asks.Quit(Mod+Q, taken fromClose window) closes the windows one at a time, the caller first and then the others in the order they were first seen, each through its own close request. A destroyed window moves the quit on, andCancelends it, leaving that window and every window not yet asked open. A window whose close request is still unanswered is not asked again, since a second request closes a window without asking.open_new_windowis an async command because creating a window from a synchronous command deadlocks on Windows.core:window:allow-unminimize. The test-only WebDriver capability covers every window rather thanmain, so the desktop suite can drive the new ones.New window,Close window,Quit), Help, and the changelog describe windows.Related Issue
Closes #642
Refs #639
Verification
windowtests: windows close in turn during a quit; a quit declined in its second window leaves that window and the rest open; a decline from a window not being closed, a window closed out of turn, and a second quit while one is under way leave the sequence intact; new windows get distinct labels and cascade, falling back to the work-area corner.window_documentsandpath_utilstests: a claim succeeds on a path no window holds and is refused for one another window holds under any spelling, lasts until the window reports its documents, and is freed when its window is destroyed; windows keep first-seen order; relative and empty paths are refused; Rust path identity keys match the frontend's for Windows and POSIX paths.openSession,windowDocumentClaims,useWindowDocuments,crossWindowDocuments, andotherWindowDocuments: opening a file another window holds shows it there without reading it, a failed open gives its claim back, a folder opens without an index file held elsewhere, a window reports its documents and follows the others', and a rename or deletion in another window moves this window's tabs or marks them missing with their text kept.documentWorkflows,folderEntryWorkflows,folderSearchEngine,folderReplaceWorkflows, andfolderSearchWorkflows: theSave asrefusal, rename and delete forwarding, the Replace in folder skip and its re-plan, a file that gains unsaved changes elsewhere during a replacement, and a match in another window's file.app,fileactions,shortcutReference, andcommand-menubar: the close dialog brings its window forward, Always on top follows a change made in another window,New windowandQuitreach the backend, andMod+Qbelongs toQuit.pnpm checkandpnpm test:e2e:desktop:runnerpassed.Not verified: the new
multiple-windowsdesktop scenario and the rest of the desktop E2E suite, which CI runs. Outside that scenario, no native window behavior was exercised in the running app: opening and placing windows, focus across windows, the quit sequence, the filtered window state, and settings, including Always on top, changing in every window.Notes
Quitwaits on each window's frontend, so a window whose frontend stops responding stalls it until that window's close button is clicked twice, which closes it without asking.