Skip to content

fix:修复背景渲染问题#432

Merged
phantom5099 merged 4 commits into1024XEngineer:mainfrom
creatang:main
Apr 23, 2026
Merged

fix:修复背景渲染问题#432
phantom5099 merged 4 commits into1024XEngineer:mainfrom
creatang:main

Conversation

@creatang
Copy link
Copy Markdown
Collaborator

No description provided.

@creatang creatang changed the title fix fix:修复背景渲染问题 Apr 23, 2026
Copy link
Copy Markdown

@fennoai fennoai Bot left a comment

Choose a reason for hiding this comment

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

发现 2 个需要修正的问题(性能与安全未见新增风险):

  1. startDraftSessionstartupScreenLocked 强制设为 true,导致 Ctrl+N 新建草稿后重新显示启动页,和现有交互契约冲突。
  2. 滚动条轨道与滑块都取消背景后仍用空格渲染,视觉上不可区分,滚动位置反馈丢失。

Comment thread internal/tui/core/app/update.go Outdated
func (a *App) startDraftSession() {
a.setActiveSessionID("")
a.startupScreenLocked = false
a.startupScreenLocked = true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] 这里把 startupScreenLocked 设为 true 会让 Ctrl+N 创建新草稿后重新锁回启动页,破坏“进入主视图继续对话”的现有行为。仓库内现有测试 TestUpdateFocusInputNewSessionAndTodoScroll 已可复现该回归。建议保持新草稿会话为 unlocked(与 Ctrl+N 交互语义一致)。

@@ -238,8 +238,8 @@ func (a App) renderTranscriptScrollbar(width int, height int) string {
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] trackStylethumbStyle 都改成 UnsetBackground(),而渲染字符仍是空格,结果轨道与滑块在终端中通常完全不可见。建议至少保留两者可区分的可视样式(例如不同前景字符,或非背景型高亮方案),否则用户无法感知滚动位置。

@creatang
Copy link
Copy Markdown
Collaborator Author

/code 解决ci问题和review提到的安全问题

@fennoai
Copy link
Copy Markdown

fennoai Bot commented Apr 23, 2026

处理结果

已完成修复并推送到当前 PR 分支 creatang:main(commit: 997f777)。

变更说明

  • 修复 Ctrl+N 新建草稿会话回归:startDraftSession() 保持启动页为 unlocked,避免重新锁回启动页。
  • 修正对应测试断言,保持与交互语义一致。
  • 修复滚动条不可见问题:改为前景字符渲染(| 轨道 + # 滑块),不依赖背景色,也能清晰区分轨道/滑块。

验证

  • go test ./internal/tui/core/app -run 'TestStartupCtrlNStartsDraftSession|TestUpdateFocusInputNewSessionAndTodoScroll|TestStartDraftSessionResetsRunState' -count=1
  • go test ./internal/tui/core/app -count=1
  • go test ./...

未执行项

  • 未新增额外功能,仅完成触发评论要求的 CI 修复与 review 问题修复。

View job run

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: creatang <165447160+creatang@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/tui/core/app/view.go 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@phantom5099 phantom5099 merged commit 1760968 into 1024XEngineer:main Apr 23, 2026
2 checks passed
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.

3 participants