(state: MakaPiTranscriptState)
| 431 | * toggle still flips the default and appends a notice saying why. |
| 432 | */ |
| 433 | export function toggleAllToolExpansion(state: MakaPiTranscriptState): boolean { |
| 434 | if (togglesInert(state)) return false; |
| 435 | const candidates = state.entries.filter( |
| 436 | (entry): entry is MakaPiToolEntry => entry.kind === 'tool', |
| 437 | ); |
| 438 | if (candidates.length === 0) return false; |
| 439 | state.expandAllTools = !state.expandAllTools; |
| 440 | const targets = candidates.filter((entry) => entryInLiveViewport(state, entry)); |
| 441 | for (const entry of targets) entry.expanded = state.expandAllTools; |
| 442 | if (targets.length === 0) { |
| 443 | state.entries.push({ |
| 444 | kind: 'notice', |
| 445 | level: 'info', |
| 446 | text: `No tool card in view to toggle — cards above stay as rendered in scrollback. New tool output starts ${state.expandAllTools ? 'expanded' : 'collapsed'}.`, |
| 447 | }); |
| 448 | } |
| 449 | return true; |
| 450 | } |
| 451 | |
| 452 | /** |
| 453 | * Toggle every thinking entry in the live viewport at once and flip the |
no test coverage detected