Skip to content

Commit 81a4889

Browse files
bradjennclaude
andcommitted
fix: clear stale column focus memory on expel and absorb
When a tab moved between columns (expel/absorb), columnFocusedTab still pointed to the moved tab's ID. focusLeft/focusRight would then resolve to the wrong column, making Cmd+H appear stuck after expelling a pane from the bottom of a column. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 65a6605 commit 81a4889

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Blink/Store/AppStore.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,11 @@ final class AppStore {
556556
cols[sourceIdx].tabIds.removeLast()
557557
cols[colIdx].tabIds.append(absorbedTabId)
558558

559+
// Clear stale focus memory if it pointed to the moved tab
560+
if columnFocusedTab[cols[sourceIdx].id] == absorbedTabId {
561+
columnFocusedTab.removeValue(forKey: cols[sourceIdx].id)
562+
}
563+
559564
// Remove source column if empty
560565
if cols[sourceIdx].tabIds.isEmpty {
561566
columnFocusedTab[cols[sourceIdx].id] = nil
@@ -579,6 +584,11 @@ final class AppStore {
579584
cols[sourceIdx].tabIds.removeLast()
580585
cols[colIdx].tabIds.append(absorbedTabId)
581586

587+
// Clear stale focus memory if it pointed to the moved tab
588+
if columnFocusedTab[cols[sourceIdx].id] == absorbedTabId {
589+
columnFocusedTab.removeValue(forKey: cols[sourceIdx].id)
590+
}
591+
582592
// Remove source column if empty
583593
if cols[sourceIdx].tabIds.isEmpty {
584594
columnFocusedTab[cols[sourceIdx].id] = nil
@@ -600,6 +610,9 @@ final class AppStore {
600610
// Remove tab from current column
601611
cols[colIdx].tabIds.removeAll { $0 == activeTabId }
602612

613+
// Clear stale focus memory — the expelled tab no longer lives in this column
614+
columnFocusedTab.removeValue(forKey: currentCol.id)
615+
603616
// Create new column to the right
604617
let newCol = Column(id: UUID().uuidString, tabIds: [activeTabId])
605618
cols.insert(newCol, at: cols.index(after: colIdx))

0 commit comments

Comments
 (0)