Skip to content

Conversation

@x22x22
Copy link

@x22x22 x22x22 commented Oct 31, 2025

TLDR

  • Introduce a shared ScrollView for Ink layouts, reworking the subagent runtime panel to support truncation and scrolling.
  • Make TodoDisplay scrollable with tests that cover truncation, preserving keyboard affordances for long lists.
  • Ensure compact subagent mode surfaces the ctrl+e hint so display toggles remain discoverable.

Dive Deeper

  • This iteration substantially reduces the runtime pane flicker without fully eliminating it; a follow-up branch will introduce an alternative full-view TODO panel UI for further refinement.
  • ScrollView centralizes scroll/overflow handling and powers the updated AgentExecutionDisplay, letting verbose sections collapse while keeping recent content visible.
  • TodoDisplay now consumes that component, trims excess history, and ships with focused unit tests validating scrolling boundaries and placeholder rendering.
  • The runtime footer now renders in compact mode, and the hidden-section indicator messaging is aligned with the new scrolling behavior.

Reviewer Test Plan

  • Run npm run test -- TodoDisplay to execute the new unit coverage.
  • Start a CLI session, trigger a long-running subagent, and verify the runtime pane scrolls while showing ctrl+e hints in each display mode.
  • Create enough TODO history to exceed the viewport and confirm the list scrolls with the latest items anchored.

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

The post-repair efficacy:

Fix-task-todo-scroll-flicker.mov

@x22x22 x22x22 changed the title Fix/task todo scroll flicker Fix/task panel scroll flicker Nov 1, 2025
@tanzhenxin
Copy link
Collaborator

@x22x22 Thanks for your contribution!

The flicker issue in CLI is an inherit problem caused by Ink library, which affects both Gemini CLI and Qwen Code. We noticed it happened a lot for dynamically update components like AgentExecutionDisplay and QwenOAuthProgress etc, when the terminal height is not enough to hold the full height of the component plus some extra fixed height.

In order to mitigate this flicker issue, take AgentExecutionDisplay for example, we designed three display modes: compact, default and verbose, with compact mode needing the least screen space in height, which would cause less trouble(though it still might cause screen flicker if the terminal height is too small).

I notice that in your implementation, you truncate the content of agent execution display if the screen height is not enough, even when user choose to display more information, which is not quite what we expect. And the display for TodoDisplay looks wired now.

To tackle this flicker issue, from my understanding, it is better to solve it in the Ink side, which should allow dynamic updated content display in any height without trouble. And if we want a workaround with some ScrollView component, we need to make sure the contents intended to be displayed to user will be there in some way.

@x22x22
Copy link
Author

x22x22 commented Nov 3, 2025

@x22x22 Thanks for your contribution!

The flicker issue in CLI is an inherit problem caused by Ink library, which affects both Gemini CLI and Qwen Code. We noticed it happened a lot for dynamically update components like AgentExecutionDisplay and QwenOAuthProgress etc, when the terminal height is not enough to hold the full height of the component plus some extra fixed height.

In order to mitigate this flicker issue, take AgentExecutionDisplay for example, we designed three display modes: compact, default and verbose, with compact mode needing the least screen space in height, which would cause less trouble(though it still might cause screen flicker if the terminal height is too small).

I notice that in your implementation, you truncate the content of agent execution display if the screen height is not enough, even when user choose to display more information, which is not quite what we expect. And the display for TodoDisplay looks wired now.

To tackle this flicker issue, from my understanding, it is better to solve it in the Ink side, which should allow dynamic updated content display in any height without trouble. And if we want a workaround with some ScrollView component, we need to make sure the contents intended to be displayed to user will be there in some way.


@tanzhenxin

那么我这边先关闭这个pr,不用这种方式来实现。

I will proceed to close this pull request, as this implementation approach is not suitable.

@x22x22
Copy link
Author

x22x22 commented Nov 3, 2025

@tanzhenxin

#953

我关闭了这个pr,提交了一个新的pr,请帮忙审核,谢谢

I've closed this PR and submitted a new one. Please help review it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants