Merge pull request #419 from manaflow-ai/task-bonsplit-tab-drag-lag-debug-logging

Add debug timing logs for bonsplit tab transfer lag repro
This commit is contained in:
Lawrence Chen 2026-02-23 23:59:01 -08:00 committed by GitHub
commit 6a3c0bd6f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 600 additions and 61 deletions

View file

@ -3081,6 +3081,51 @@ final class WorkspacePanelGitBranchTests: XCTestCase {
#endif
}
func testDetachAttachAcrossWorkspacesPreservesNonCustomPanelTitle() {
let source = Workspace()
guard let panelId = source.focusedPanelId else {
XCTFail("Expected source focused panel")
return
}
XCTAssertTrue(source.updatePanelTitle(panelId: panelId, title: "detached-runtime-title"))
guard let detached = source.detachSurface(panelId: panelId) else {
XCTFail("Expected detach to succeed")
return
}
XCTAssertEqual(detached.cachedTitle, "detached-runtime-title")
XCTAssertNil(detached.customTitle)
XCTAssertEqual(
detached.title,
"detached-runtime-title",
"Detached transfer should carry the cached non-custom title"
)
let destination = Workspace()
guard let destinationPane = destination.bonsplitController.allPaneIds.first else {
XCTFail("Expected destination pane")
return
}
let attachedPanelId = destination.attachDetachedSurface(
detached,
inPane: destinationPane,
focus: false
)
XCTAssertEqual(attachedPanelId, panelId)
XCTAssertEqual(destination.panelTitle(panelId: panelId), "detached-runtime-title")
guard let attachedTabId = destination.surfaceIdFromPanelId(panelId),
let attachedTab = destination.bonsplitController.tab(attachedTabId) else {
XCTFail("Expected attached tab mapping")
return
}
XCTAssertEqual(attachedTab.title, "detached-runtime-title")
XCTAssertFalse(attachedTab.hasCustomTitle)
}
func testBrowserSplitWithFocusFalseRecoversFromDelayedStaleSelection() {
let workspace = Workspace()
guard let originalFocusedPanelId = workspace.focusedPanelId else {