Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
willTerminateaggregate save.Architecture (commit 1: refactor)
Three new types under
TablePro/:ViewModels/ConnectionDataCache—@MainActor @Observableper-connection singleton holdingfolders,favorites,linkedFolders,linkedFilesByFolderId. Subscribes to.sqlFavoritesDidUpdateand.linkedSQLFoldersDidUpdate.scheduleRefresh()cancels in-flight tasks so notification storms coalesce.ViewModels/ConnectionSidebarState— per-connection holder forselectedFavoriteNodeId, persisted to UserDefaults viadidSetso cross-window selection sync and across-launch persistence share one code path.Models/UI/WindowSidebarState— per-window holder forfavoritesSearchText, owned byMainContentCoordinator.FavoritesSidebarViewModelbecomes a thin facade over the cache:nodesis a computed property,loadFavorites()/isLoading/ observer plumbing removed. The sidebar's singleNSSearchField(inSidebarContainerViewController) routes toSharedSidebarState.searchTexton Tables andWindowSidebarState.favoritesSearchTexton Favorites based on the active tab.Two render-timing fixes for the new-tab mount path:
.transaction { animation = nil }on the SidebarView root (matching the existing pattern inbuildDetailView), andview.layoutSubtreeIfNeeded()+view.display()inMainSplitViewController.viewWillAppearso SwiftUI evaluates and renders before AppKit's tab-slide animation completes.Persistence fix (commit 2)
Three save paths each saved only
tabManager.tabs(current window) instead of aggregated tabs across all windows of the connection. On Cmd+Q, AppKit closes windows LIFO and the last per-window save overwrote thewillTerminateobserver's aggregated save with a single-tab payload.MainContentView+EventHandlers.handleTabSelectionChangenow writesMainContentCoordinator.aggregatedTabs(for:)instead oftabManager.tabs. Tab-switch in window 1 no longer drops windows 2/3 from the saved file.MainContentCommandActions.setupWindowObserversskips duringisAppTerminatingand routes throughsaveOrClearAggregated()otherwise.MainContentCoordinator+WindowLifecycle.handleWindowWillCloseskips its save during quit; thewillTerminateobserver's aggregate save is now the only quit-time write.Test plan
.sqlfile externally — both windows refresh within ~1.5 s viaSQLFolderWatchernotification.swiftlint lint --strictpasses.