MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / closeMatching

Function closeMatching

ui/src/tabs/store.ts:172–184  ·  view source on GitHub ↗
(predicate)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getFocusedGroupFunction · 0.90
getFunction · 0.50

Tested by

no test coverage detected