(predicate)
| 170 | }, |
| 171 | |
| 172 | closeMatching(predicate) { |
| 173 | // Snapshot ids first — closeTab mutates the array we'd be iterating. |
| 174 | const state = get() |
| 175 | const group = getFocusedGroup(state) |
| 176 | if (!group) return |
| 177 | const toClose = group.tabIds |
| 178 | .map((id) => state.tabs[id]) |
| 179 | .filter((t): t is Tab => t != null && predicate(t.spec)) |
| 180 | .map((t) => t.id) |
| 181 | for (const id of toClose) { |
| 182 | get().closeTab(id) |
| 183 | } |
| 184 | }, |
| 185 | |
| 186 | // ============= Bulk closers (for the tab context menu) ============= |
| 187 | // All four delegate to closeTab so the neighbour-focus / no-fallback |
nothing calls this directly
no test coverage detected