( node: RightSidebarLayoutNode )
| 479 | * Returns tabs in layout order (depth-first, left-to-right/top-to-bottom). |
| 480 | */ |
| 481 | export 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). |
no outgoing calls
no test coverage detected