fix(mobile): honor host-follow tab snapshots

(cherry picked from commit a4a9c4da19d6967eceb8025dd01480a56261039f)
This commit is contained in:
Neil
2026-08-31 21:16:46 -07:00
parent 3343d39d54
commit 0f184fac2c
4 changed files with 17 additions and 4 deletions
-2
View File
@@ -40,9 +40,7 @@ inline src/renderer/src/store/slices/tabs.ts
inline src/renderer/src/store/slices/ui.ts
inline src/shared/keybindings.ts
mobile-config app/h/*/files/*.tsx
mobile-config app/h/*/session/*.tsx
mobile-config app/h/*/source-control/*.tsx
mobile-config app/index.tsx
mobile-config scripts/mock-server.ts
mobile-config src/terminal/terminal-webview-html.ts
mobile-config src/transport/rpc-client.ts
@@ -27,4 +27,17 @@ describe('mobile session last-tab close', () => {
'reconcileBufferedDraftsRef.current(sessionTabsRef.current, remainingTabs)'
)
})
it('ignores a pending terminal handle when the host requests follow navigation', () => {
const start = sessionRouteSource.indexOf('const applySessionTabs = useCallback')
const end = sessionRouteSource.indexOf('const readMarkdownTab', start)
const block = sessionRouteSource.slice(start, end)
const followsHost = block.indexOf("const followsHost = result.navigationIntent === 'follow'")
const pendingHandle = block.indexOf('const pendingActiveTerminalHandle = followsHost')
expect(followsHost).toBeGreaterThanOrEqual(0)
expect(pendingHandle).toBeGreaterThan(followsHost)
expect(block.slice(pendingHandle, pendingHandle + 150)).toContain('? null')
})
})
@@ -66,7 +66,7 @@ const HEAD_MAIN_HOOK_SHA256 = '5c475b904928f418c76a7885afdbed7adbfea3fe3ea05e85d
const HEAD_HOOK_BINDING_SHA256 = '028f99dd14fea2110cff446418ee71513aeed38484c2dcea68bf0da8eff377c0'
const HEAD_CALLBACK_IDENTITY_SHA256 =
'd60ffe53f8d77f2dd3ebd14a5de162bb399113c170b59bdc917de6318ec433ec'
const HEAD_CALLBACK_BODY_SHA256 = '07803db6b4ca4c3c02090bea0e774b0f2a8580dd5a8417227d5b4a63645a0817'
const HEAD_CALLBACK_BODY_SHA256 = '69dfda53fd700f4395a18a37ffdaa530e187bc24b4986d8fdc0184127c00b52d'
const HEAD_EFFECT_SHA256 = '346d384ea0bf2f8f926c5092c5bf57bc2a03494f49f9639e9d6b8a2c51c9f882'
const HEAD_CONTENT_HOOK_SHA256 = '9c3b612fef3f370d66873aefdbe1d701f20cb64ded31fef5cc45fde6f8189581'
const HEAD_NESTED_FUNCTION_SHA256 =
@@ -108,8 +108,10 @@ export function useMobileSessionTabApplication(scope: MobileSessionTerminalListM
}
const pendingActiveSessionTabId = pendingActiveSessionTabIdRef.current
const pendingActiveTerminalHandle = pendingActiveTerminalHandleRef.current
const followsHost = result.navigationIntent === 'follow'
const pendingActiveTerminalHandle = followsHost
? null
: pendingActiveTerminalHandleRef.current
if (followsHost) {
pendingActiveTerminalHandleRef.current = null
pendingBrowserFocusPageIdRef.current = null