From 8595f01a454f213e1bae1b59bce8dad08bb05f37 Mon Sep 17 00:00:00 2001 From: MacKinley Smith Date: Sat, 12 Sep 2026 19:13:57 -0600 Subject: [PATCH] fix(swift-ios): reopened threads no longer show stale history after swipe back Leaving a thread with the swipe-back gesture cleared the selection, which destroyed the thread view while the split view was still finishing its interactive pop. The next open of that thread received onAppear followed by a spurious onDisappear, and releaseThread cancelled the load before it could subscribe or arm the HTTP fallback. The view then showed the cached transcript with no sync indicator until the user backed out and reopened. Collapse the compact column on swipe back and keep the selection, which is what the system back button already does. The view is re-shown instead of recreated, its task re-runs, and the cached resume replays new events. Model: Claude Fable 5.1. Harness: Claude Code inside T3 Code. --- apps/swift-ios/Features/Workspace/WorkspaceView.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/swift-ios/Features/Workspace/WorkspaceView.swift b/apps/swift-ios/Features/Workspace/WorkspaceView.swift index 38b83c823cce..ae52de484cf0 100644 --- a/apps/swift-ios/Features/Workspace/WorkspaceView.swift +++ b/apps/swift-ios/Features/Workspace/WorkspaceView.swift @@ -329,7 +329,7 @@ public struct WorkspaceView: View { model: model, thread: thread, submitMessage: submitMessage, - onNavigateBack: closeSelectedThread + onNavigateBack: collapseToSidebar ) .id(id) } else { @@ -638,6 +638,15 @@ public struct WorkspaceView: View { preferredCompactColumn = .sidebar } + /// Compact-width swipe back. Mirrors the system back button: collapse the + /// column but keep the selection so the thread view is re-shown, not + /// destroyed and recreated. Recreating it inside the split view's + /// interactive pop fires a spurious onDisappear on the next open, which + /// releases the thread mid-load and leaves stale cached content. + private func collapseToSidebar() { + preferredCompactColumn = .sidebar + } + @MainActor private func openProjectCreation() { showingNewTask = false