MCPcopy
hub / github.com/coder/mux / collectAllTabsWithTabset

Function collectAllTabsWithTabset

src/browser/utils/rightSidebarLayout.ts:481–491  ·  view source on GitHub ↗
(
  node: RightSidebarLayoutNode
)

Source from the content-addressed store, hash-verified

479 * Returns tabs in layout order (depth-first, left-to-right/top-to-bottom).
480 */
481export function collectAllTabsWithTabset(
482 node: RightSidebarLayoutNode
483): Array<{ tab: TabType; tabsetId: string }> {
484 if (node.type === "tabset") {
485 return node.tabs.map((tab) => ({ tab, tabsetId: node.id }));
486 }
487 return [
488 ...collectAllTabsWithTabset(node.children[0]),
489 ...collectAllTabsWithTabset(node.children[1]),
490 ];
491}
492
493/**
494 * Select a tab by its position in the layout (0-indexed).

Callers 4

handleKeyDownFunction · 0.90
RightSidebarComponentFunction · 0.90
selectTabByIndexFunction · 0.85
selectOrAddTabFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected