fix: keep floating tabs in GetAllWindowsFromDockPanel - #687
Merged
Conversation
PR #685 changed the method to enumerate DockPanel.Panes so the returned order matches the visible tab strips, but filtered the panes down to DockState.Document. LogWindows may also float (DockAreas.Document | DockAreas.Float is set in LogTabWindow.AddLogWindow), so any floated tab was dropped from the result. That silently lost floated tabs from LastOpenFilesList on exit, and from the FileNames list written to .lxj session files - where the layout XML still referenced the window, leaving the entry to vanish on restore. Enumerate panes of every dock state, and read DisplayingContents rather than Contents so the order is the one the tab strip renders.
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.
Follow-up to #685.
That PR fixed the tab restore order by enumerating
DockPanel.Panesinstead ofDockPanel.Contents, but narrowed the panes toDockState.Document.LogWindowsetsDockAreas = DockAreas.Document | DockAreas.Float(LogTabWindow.AddLogWindow, line 836), so a floated tab lives in a pane withDockState.Floatand was dropped from the result. The Developer had not enough time to fix this, because I merged the PR to fast.Two consumers were affected:
FileOperationService.SaveLastOpenFilesList— a floated tab was not written toLastOpenFilesList, so it did not come back on the next start.LogTabWindow.OnSaveSessionToolStripMenuItemClick— a floated tab was missing from the.lxjFileNameslist, whileTabLayoutXmlstill referenced it. On restoreDeserializeDockContent→FindWindowForFilereturns null for it and the entry silently disappears.This drops the dock-state filter, and reads
DisplayingContentsinstead ofContents— that is the collection the tab strip renders, so it is the more direct expression of "tab order" and it excludes non-displaying contents. In practice the two are equivalent today: noLogWindowis ever hidden without being closed, andLogWindow'sDockAreasrules out auto-hide.The ordering fix from #685 is unchanged and still works.
Known limitation, unchanged by this PR
DockPanel.Panesis in pane-creation order, not visual left-to-right, so order is correct within a pane and arbitrary across panes. A split document area still restores in a semi-arbitrary order. Fixing that needs a different source of truth than the pane collection.Testing
LogExpert.UIbuilds clean; the 29TabControllerTestspass.No regression test added:
TabControllerTestsdocuments thatLogWindowcannot be instantiated without full UI infrastructure, andOfType<LogWindow>()filters out any plainDockContentstub, so the floating case is not reachable from that fixture.