Skip to content

fix: 修复 TUI 通知列表溢出顶掉顶部状态 - #37

Merged
yyy-router merged 2 commits into
mainfrom
fix/tui-notification-overflow
Nov 4, 2026
Merged

yyy-router merged 2 commits into
mainfrom
fix/tui-notification-overflow

Conversation

@yyy-router

Copy link
Copy Markdown
Owner

概述

修复 TUI 通知列表在多行消息较多时把顶部额度、网络状态顶出屏幕的问题。

根因

  • NotificationList 的 MAX_ROWS = 6 限制的是“6 条通知”,不是“6 行”
  • 聚合完成通知正文包含换行,wrap="truncate" 只按宽度截断,不折叠换行
  • 一条通知可能渲染多行,6 条可超过终端高度,Ink 滚动后顶部状态不可见
  • 布局没有使用终端 rows 做高度约束
  • 竖线高度按条目数计算,与实际渲染行数不一致

改动

  • 通知正文折叠换行与连续空白,保证每条通知只占 1 行
  • NotificationList 新增 maxRows,按可见条数裁剪
  • App 读取终端 rows,扣除头部/额度面板/边框/快捷键后计算 maxRows
  • 竖线高度改为与实际列表行数一致
  • App 新增测试用 rows 注入

验证

  • 新增 3 个测试:多行折叠、maxRows 裁剪、终端高度不足时总行数不超屏
  • TDD:实现前 3 个用例均失败,实现后通过
  • npm run typecheck 通过
  • npm test:319 通过 + 1 跳过(320)

说明

  • 本次只调整 TUI 渲染,不改变通知推送频率或聚合逻辑
  • 可见条数上限仍为 6;终端较矮时会进一步减少,最新通知优先

Closes #36

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The changes affect only the CodexMonitor terminal display.

The short-terminal overflow should be fixed before merging.

Findings

  1. P1 Top status still scrolls away ▶

Summary

Collapses notification messages to one line and limits the visible list using terminal height.

  • The TUI keeps recent notifications within the terminal’s available height.

Reviews (1) · Last reviewed commit: "fix: 修复 TUI 通知列表溢出顶掉顶部状态" · Reviewed by Greptile

Comment thread src/tui/app.tsx Resolved
@yyy-router
yyy-router merged commit d7dafbc into main Nov 4, 2026
2 checks passed
@yyy-router
yyy-router deleted the fix/tui-notification-overflow branch November 4, 2026 02:44
This was referenced Nov 4, 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.

fix: 修复 TUI 通知列表溢出顶掉顶部状态

1 participant