fix(tui): complete phased TUI updates (#266)#286
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
/review |
| promptHeight := lipgloss.Height(a.renderPrompt(width)) | ||
| transcriptHeight := max(6, height-activityHeight-menuHeight-promptHeight) | ||
| return transcriptHeight, activityHeight, menuHeight, promptHeight | ||
| transcriptHeight := max(6, height-activityHeight-menuHeight) |
There was a problem hiding this comment.
waterfallMetrics no longer reserves vertical space for the prompt (and it also does not account for the optional Thinking... row), but renderWaterfall still appends those blocks later. This can make rendered content taller than the placed container, causing clipping and desync with hit-testing/layout math (inputBounds/activityBounds). Please keep metrics and rendered sections in sync from a single height model.
| copyButtons := make([]copyCodeButtonBinding, 0, 4) | ||
| nextCopyID := 1 | ||
| for _, message := range a.activeMessages { | ||
| if message.Role == roleTool { |
There was a problem hiding this comment.
This skips all roleTool messages during transcript rebuild, and renderMessageBlockWithCopy now also returns early for tool messages. That removes tool output/failure visibility from the transcript, which is a behavior regression for debugging and auditability. If this is intentional, consider keeping at least a compact tool summary or a feature flag.
| @@ -470,30 +406,11 @@ func (a App) computeLayout() layout { | |||
| helpHeight := a.helpHeight(contentWidth) | |||
There was a problem hiding this comment.
computeLayout now returns only contentWidth/contentHeight, and renderBody no longer renders a sessions pane. However, sessions focus and handlers still exist in update/key handling. This leaves a hidden Sessions focus state with no visible UI, so users can cycle into an invisible panel and lose direct session browsing/opening from the main screen. Please either keep a visible sessions surface or remove/guard sessions-panel focus/actions consistently.
| } | ||
|
|
||
| // waterfallMetrics 统一计算瀑布区各组件高度,确保渲染、布局与命中区域使用同一组尺寸。 | ||
| func (a App) waterfallMetrics(width int, height int) (int, int, int, int) { |
There was a problem hiding this comment.
waterfallMetrics no longer subtracts prompt height, but renderWaterfall still appends the prompt (and may append Thinking...). Under constrained heights or multi-line input, rendered body height can exceed the allocated contentHeight, causing clipping/overflow. Please include prompt/extra-line height in the same sizing model used for transcript/activity/menu.
| tagStyle = a.styles.messageUserTag | ||
| bodyStyle = a.styles.messageUserBody | ||
| blockAlign = lipgloss.Right | ||
| case roleTool: |
There was a problem hiding this comment.
Tool messages are now dropped from transcript rendering (roleTool returns early). This is a user-visible behavior change that removes direct visibility of tool call/results in chat history, which hurts debugging/auditability. If intentional, this should be explicitly documented and covered by tests; otherwise, keep tool messages visible (or provide a dedicated, persistent tool-output view).
背景
本 PR 汇总了本轮 TUI 分阶段改造(Phase 1~4)以及后续修复,目标是解决
#266中提到的可用性问题,尤其是:#266
Issue: #266 (comment)
主要改动
headerBarHeight=2)Thinking...提示移到正文区域,减少 header 污染[ YOU ]标签与正文右对齐边界不一致问题影响文件
internal/tui/core/app/view.gointernal/tui/core/app/styles.gointernal/tui/core/app/app.gointernal/tui/core/app/view_test.go测试
已通过:
go test ./internal/tui/core/app ./internal/tui/...