Skip to content

BUG: Compact mode tool merge causes full-screen flash on every tool batch #4794

@zzhenyao

Description

@zzhenyao

What happened?

When compact mode is on (Ctrl+O), consecutive tool groups get merged by mergeCompactToolGroups in packages/cli/src/ui/components/MainContent.tsx:191. The merge replaces N history items with a single merged item, so the array shrinks — say, from 5 entries down to 3.

Ink's <Static> component tracks items by key. When the number of keys changes, it can't do its normal append-only update. A useEffect in the same file (line 275) detects the length mismatch and calls refreshStatic(), which writes clearTerminal to stdout and remounts the entire <Static> tree.

The result is a visible full-screen flash every time a batch of tool calls completes. On sessions with frequent tool use (file reads, shell commands in sequence) this becomes distracting fast.

Image

What did you expect to happen?

No full-screen redraw when tools finish. The history array should stay stable so <Static> can append new items without tearing down what's already on screen.

Client information

N/A

Login information

N/A

Anything else we need to know?

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/uiUser interface and displaypriority/P2Medium - Moderately impactful, noticeable problemscope/componentsUI components and widgetsscope/renderingDisplay and rendering logicstatus/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expected

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions