Preserve iOS workspace search across detail navigation

Closed
AZ
4mo ago
+98-44

Keep workspace-detail pushes inside the active Search tab navigation stack. Returning with Back or an edge swipe reopens the same search presentation, query, keyboard focus, filtered list, and retained list position.

The first commit adds the behavior-level XCUITest. The second implements the navigation ownership fix.

Stacked on https://github.com/manaflow-ai/cmux/pull/9859 so the verified toolbar checkpoint remains intact.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


[!NOTE]
Medium Risk
Changes iOS primary-tab navigation ownership for search-to-workspace flows; behavior is covered by an expanded UI test but touches compact-stack coordination and search coordinator presentation.

Overview
Workspace detail from Search now pushes inside the Search tab’s navigation stack instead of switching to the Workspaces tab and deferring navigation. selectWorkspaceFromSearch sets workspaceSearchNavigationPath and records whether expanded search was active so Back or swipe-back can call restoreWorkspaceSearchPresentationIfNeeded() and reopen search via primarySearchCoordinator.setPresentation(true).

The Search tab NavigationStack gains navigationDestination for workspace IDs (custom back button, swipe-back enabler) and hides the root toolbar while detail is shown. Compact-stack selection sync skips updating compactNavigationPath while a search-stack detail is open.

The DEBUG list preview fixture mirrors the same pattern (searchFixtureRoute, shared fixtureWorkspaceDetail) and drops the old pending-route / tab-hop consumption logic.

XCUITest testWorkspaceSearchRestoresPresentationQueryAndResultsAfterWorkspaceDetailAndRefresh now asserts expanded search field, preserved query, keyboard focus, filtered rows, and stability after preview refresh—not only minimized search chrome.

Reviewed by Cursor Bugbot for commit c4704c01f9d22f3f11defd956d25d1812424bbee. Bugbot is set up for automated code reviews on this repo. Configure here.