(label: string)
| 80 | } |
| 81 | |
| 82 | async function findMenuItem(label: string): Promise<HTMLButtonElement> { |
| 83 | return waitFor( |
| 84 | () => { |
| 85 | const buttons = Array.from(document.querySelectorAll("button")) as HTMLButtonElement[]; |
| 86 | const menuItem = buttons.find((button) => button.textContent?.includes(label)); |
| 87 | if (!menuItem) { |
| 88 | throw new Error(`Menu item not found: ${label}`); |
| 89 | } |
| 90 | return menuItem; |
| 91 | }, |
| 92 | { timeout: 10_000 } |
| 93 | ); |
| 94 | } |
| 95 | |
| 96 | function getAncestorTrunkSegments(container: HTMLElement, workspaceId: string): HTMLElement[] { |
| 97 | const connector = getSubagentConnector(container, workspaceId); |
no test coverage detected