refactor: replace native window tabs with in-app tab bar#763
Open
refactor: replace native window tabs with in-app tab bar#763
Conversation
…switching Native macOS window tabs used addTabbedWindow() which took 600-900ms per call, causing severe lag on Cmd+T and tab restoration. This refactor moves to a single-window-per-connection architecture with a custom SwiftUI tab bar, eliminating the N² view lifecycle cascades during tab restore.
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
addTabbedWindow, 600-900ms per call) with a custom SwiftUIEditorTabBarfor instant tab switchingopenTableTab,newTab, FK navigation, favorites, etc.) now adds in-app tabs instead of creating newNSWindowinstancesKey changes
New components:
EditorTabBar/EditorTabBarItem— custom tab bar with drag-to-reorder, close buttons, context menus, preview tab styling, dirty indicatorsMainContentCoordinator+TabOperations— tab lifecycle operations (close, reorder, rename, duplicate)Redirected navigation (13 call sites):
MainContentCoordinator+Navigation— 5 sites (active work guard, default open, preview paths)MainContentCoordinator+SidebarActions— 3 sites (createNewTable, createView, editView)MainContentCoordinator+FKNavigation— 1 siteMainContentCoordinator+Favorites— 1 siteMainContentCoordinator— 2 sites (loadQueryIntoEditor, insertQueryFromAI)MainContentCommandActions— 1 site (openFile)Simplified infrastructure:
onDisappear200ms grace period (no more tab group merge cascades)Cmd+Tadds in-app tab via coordinator instead of creating native windowCmd+Wcloses in-app tab when >1 tab, closes window on last tabCmd+1-9,Cmd+Shift+[/]switch in-app tabswindow.tabbingMode = .disallowed(native window tabs only for connection grouping)Test plan