(state: MakaPiTranscriptState)
| 456 | * toggleAllToolExpansion (#1134). |
| 457 | */ |
| 458 | export function toggleAllThinkingExpansion(state: MakaPiTranscriptState): boolean { |
| 459 | if (togglesInert(state)) return false; |
| 460 | const candidates = state.entries.filter( |
| 461 | (entry): entry is MakaPiThinkingEntry => |
| 462 | entry.kind === 'thinking' && Boolean(entry.text.trim()), |
| 463 | ); |
| 464 | if (candidates.length === 0) return false; |
| 465 | state.expandAllThinking = !state.expandAllThinking; |
| 466 | const targets = candidates.filter((entry) => entryInLiveViewport(state, entry)); |
| 467 | for (const entry of targets) entry.expanded = state.expandAllThinking; |
| 468 | if (targets.length === 0) { |
| 469 | state.entries.push({ |
| 470 | kind: 'notice', |
| 471 | level: 'info', |
| 472 | text: `No thinking in view to toggle — thinking above stays as rendered in scrollback. New thinking starts ${state.expandAllThinking ? 'expanded' : 'collapsed'}.`, |
| 473 | }); |
| 474 | } |
| 475 | return true; |
| 476 | } |
| 477 | |
| 478 | export async function submitCompactToTranscript(input: { |
| 479 | state: MakaPiTranscriptState; |
no test coverage detected