Skip to content

fix(tui): cap todo panel at 5 rows with overflow indicator - #146

Merged
liruifengv merged 3 commits into
mainfrom
fix-todo
May 28, 2026
Merged

fix(tui): cap todo panel at 5 rows with overflow indicator#146
liruifengv merged 3 commits into
mainfrom
fix-todo

Conversation

@liruifengv

@liruifengv liruifengv commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

fix #121

Problem

When the agent maintains a long todo list (e.g. ten+ items), the inline TodoPanel rendered every row, pushing the editor, status line, and recent activity off-screen on short terminals. Users could no longer see what they were typing or what just happened.

What changed

  • Added a MAX_VISIBLE = 5 cap to the inline todo panel and a pure selectVisibleTodos selector that picks which rows to show based on status:
    • All in_progress items are kept (capped at 5).
    • The remaining slots are anchored on the in_progress range, biased toward upcoming pending items, while reserving one slot for the most recent done item when both sides have candidates.
    • With no in_progress: anchor between the last done and the first pending; fall back to first-5 for all-pending, last-5 for all-done.
  • Append a unified … +N more footer below the visible rows when the list is truncated.
  • Items keep their original order in the rendered output.

Algorithm and rendering are covered by unit tests for: ≤5 unchanged, in_progress with done/pending context, expansion of done side when pending is short, all-done / all-pending / mixed without in_progress, multiple in_progress, and >5 in_progress capped.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Pick visible todos around in_progress (recent done + upcoming pending),
append `+N more` when truncated.
@changeset-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4c35810

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented May 28, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@4c35810
npx https://pkg.pr.new/@moonshot-ai/kimi-code@4c35810

commit: 4c35810

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb95a7e5a6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/components/chrome/todo-panel.ts Outdated
The previous selector assumed todos were grouped as done...pending
when no in_progress existed. On interleaved orderings (the TodoList
tool keeps the model-provided order without normalizing) the before
and after windows skipped most candidates and produced fewer than
five rows. Pick directly from status buckets instead.
@liruifengv
liruifengv merged commit 76cbf86 into main May 28, 2026
6 checks passed
@liruifengv
liruifengv deleted the fix-todo branch May 28, 2026 07:17
@github-actions github-actions Bot mentioned this pull request May 28, 2026
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.

todo没有展示上限,导致占用了大半个显示区域

1 participant