Skip to content

fix(toolbar): persist customizations across window opens (#1455)#1457

Merged
datlechin merged 2 commits into
mainfrom
worktree-fix-1455-toolbar-autosave
May 28, 2026
Merged

fix(toolbar): persist customizations across window opens (#1455)#1457
datlechin merged 2 commits into
mainfrom
worktree-fix-1455-toolbar-autosave

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Closes Toolbar customizations are not persisted #1455 — toolbar customizations (drag/drop items in Customize Toolbar...) were lost on every session window reopen.
  • Two compounding issues in MainWindowToolbar.swift: the toolbar identifier embedded a fresh UUID per instance (so AppKit's autosave key was never the same twice), and autosavesConfiguration was explicitly set to false.
  • Use a single stable identifier com.TablePro.main.toolbar shared by every session window, and set autosavesConfiguration = true. AppKit handles read/write to UserDefaults under NSToolbar Configuration <identifier> automatically. This matches the documented pattern in Mail/Safari/Finder/Xcode.
  • The comment claiming the UUID prevented tab-group merging was incorrect: tab grouping is driven by NSWindow.tabbingIdentifier (already set per-connection at TabWindowController.swift:60), not by the toolbar identifier. The per-instance hostingControllers retention on each MainWindowToolbar continues to prevent the NSHostingController orphan-view problem.

Test plan

  • Open a session window, right-click the toolbar → Customize Toolbar..., drag the "Export & Import" group in, click Done.
  • Close the window, reopen it — the group should still be there.
  • Open two windows for the same connection (so they tab together), customize one, switch tabs, close one. Confirm the remaining tab's toolbar still renders every item.
  • Quit and relaunch — the customized layout should still be there.
  • Use the customize sheet's Default Set button — the layout should reset to toolbarDefaultItemIdentifiers.
  • xcodebuild test -only-testing:TableProTests/MainWindowToolbarValidationTests passes (three new tests added covering identifier stability, autosave configuration, and the allowed-items-superset invariant).

@datlechin datlechin merged commit 93ff172 into main May 28, 2026
2 checks passed
@datlechin datlechin deleted the worktree-fix-1455-toolbar-autosave branch May 28, 2026 11:54
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.

Toolbar customizations are not persisted

1 participant