diff options
| author | Adam Malczewski <[email protected]> | 2026-10-24 17:09:17 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-10-24 17:09:17 +0900 |
| commit | 0ba54b4455cb560cf7a82baf71b31ed129cfc29b (patch) | |
| tree | 424ac806b3822247c0b835ee38ffabdf87f5016e /src/features/tabs/ui/TabList.svelte | |
| parent | 83442d00d9d9c7f0ca200d6a2e8b42195708493f (diff) | |
| download | dispatch-web-0ba54b4455cb560cf7a82baf71b31ed129cfc29b.tar.gz dispatch-web-0ba54b4455cb560cf7a82baf71b31ed129cfc29b.zip | |
fix(tabs): finish accessible cascade confirmation and verify active closes
Diffstat (limited to 'src/features/tabs/ui/TabList.svelte')
| -rw-r--r-- | src/features/tabs/ui/TabList.svelte | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/features/tabs/ui/TabList.svelte b/src/features/tabs/ui/TabList.svelte index 0493b5c..8b388f0 100644 --- a/src/features/tabs/ui/TabList.svelte +++ b/src/features/tabs/ui/TabList.svelte @@ -98,7 +98,19 @@ // in the meantime is a no-op for `onClose`. A plain tab closes directly. let closeConfirm = $state<{ tab: Tab; cascadeIds: readonly string[] } | null>(null); + // A remote close or workspace switch must not leave an actionable dialog + // for a tab that is no longer in this list. + $effect(() => { + if ( + closeConfirm !== null && + !tabs.some((tab) => tab.conversationId === closeConfirm?.tab.conversationId) + ) { + closeConfirm = null; + } + }); + function requestClose(conversationId: string): void { + menu = null; const cascadeIds = cascadeCloseIds(tabs, conversationId); if (cascadeIds.length <= 1) { onClose(conversationId); |
