Skip to content

fix: keep floating tabs in GetAllWindowsFromDockPanel - #687

Merged
Hirogen merged 1 commit into
Developmentfrom
fix/tab-order-floating-panes
Jul 29, 2026
Merged

fix: keep floating tabs in GetAllWindowsFromDockPanel#687
Hirogen merged 1 commit into
Developmentfrom
fix/tab-order-floating-panes

Conversation

@Hirogen

@Hirogen Hirogen commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #685.

That PR fixed the tab restore order by enumerating DockPanel.Panes instead of DockPanel.Contents, but narrowed the panes to DockState.Document. LogWindow sets DockAreas = DockAreas.Document | DockAreas.Float (LogTabWindow.AddLogWindow, line 836), so a floated tab lives in a pane with DockState.Float and 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 to LastOpenFilesList, so it did not come back on the next start.
  • LogTabWindow.OnSaveSessionToolStripMenuItemClick — a floated tab was missing from the .lxj FileNames list, while TabLayoutXml still referenced it. On restore DeserializeDockContentFindWindowForFile returns null for it and the entry silently disappears.

This drops the dock-state filter, and reads DisplayingContents instead of Contents — 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: no LogWindow is ever hidden without being closed, and LogWindow's DockAreas rules out auto-hide.

The ordering fix from #685 is unchanged and still works.

Known limitation, unchanged by this PR

DockPanel.Panes is 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.UI builds clean; the 29 TabControllerTests pass.

No regression test added: TabControllerTests documents that LogWindow cannot be instantiated without full UI infrastructure, and OfType<LogWindow>() filters out any plain DockContent stub, so the floating case is not reachable from that fixture.

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.
@Hirogen
Hirogen merged commit 29ac05f into Development Jul 29, 2026
3 checks passed
@Hirogen
Hirogen deleted the fix/tab-order-floating-panes branch July 29, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant