MCPcopy Create free account
hub / github.com/apache/maka / toggleAllToolExpansion

Function toggleAllToolExpansion

packages/cli/src/pi-transcript.ts:433–450  ·  view source on GitHub ↗
(state: MakaPiTranscriptState)

Source from the content-addressed store, hash-verified

431 * toggle still flips the default and appends a notice saying why.
432 */
433export 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

Callers 2

runMakaPiTuiFunction · 0.85

Calls 3

togglesInertFunction · 0.85
entryInLiveViewportFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected