fix(terminal): clear retained overlay for editor tabs (#11030)

This commit is contained in:
Neil 2026-07-27 19:04:17 -07:00 committed by GitHub
parent 84c70d6e29
commit dbbeae3512
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -48,6 +48,17 @@ describe('useColdParkedTerminalPresentation', () => {
expect(presentedTargetId(hook.result)).toBe('b')
})
it('clears the terminal presentation when the group activates non-terminal content', () => {
const hook = renderPresentationHook({
desiredTargetId: 'a',
coldParkedTargetIds: new Set()
})
hook.rerender({ desiredTargetId: null, coldParkedTargetIds: new Set() })
expect(presentedTargetId(hook.result)).toBeNull()
})
it('retains the prior target until a cold target settles', () => {
const hook = renderPresentationHook({
desiredTargetId: 'a',

View File

@ -56,7 +56,7 @@ export function resolveColdParkedPresentation(
presentedTargetId: null,
pendingTargetId: null
}
if (entry.pendingTargetId === desiredTargetId) {
if (entry.pendingTargetId !== null && entry.pendingTargetId === desiredTargetId) {
next.set(scopeId, entry)
continue
}