Skip to content

fix(tui): 修复布局错位与粘贴链路,并支持运行中用户介入#486

Merged
phantom5099 merged 5 commits into1024XEngineer:mainfrom
creatang:codex/tui-scrollbar-thumb-only
Apr 28, 2026
Merged

fix(tui): 修复布局错位与粘贴链路,并支持运行中用户介入#486
phantom5099 merged 5 commits into1024XEngineer:mainfrom
creatang:codex/tui-scrollbar-thumb-only

Conversation

@creatang
Copy link
Copy Markdown
Collaborator

背景

关联 issue: #469
本 PR 聚焦 TUI 交互稳定性与可用性,主要修复:

  • 表格/内容区错位
  • 侧边滑块错位
  • 运行中用户无法中途介入

主要改动

  1. 布局与渲染错位修复
  • 调整启动页最小高度计算:改为按实际组件高度动态计算(header + 补全区 + 输入区 + 提示区),避免过高限制。

  • 优化启动页布局退化策略:空间不足时优先收缩 top margin,再按需隐藏 hints/logo,减少抖动与遮挡。

  • 修复 transcript 侧边滑块:
    宽度改为 2,改为连续块渲染,避免“断段”。

  • 修复 suggestions 首行异常位移:
    统一行前缀与选中样式逻辑,仅对选中项应用高亮样式。

  • 对 markdown 表格做终端渲染保护(表格块围栏处理),降低表格边框错位概率。

  1. 运行中“用户中途介入”
    新增介入队列机制:运行中发送输入不再丢弃,先入队。
    若当前 run 正在执行:触发 cancel,并在 run 结束/取消后自动派发队列中的介入输入。

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

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.

发现 1 个需要修复的问题(其余代码质量/性能/安全项未发现值得评论的问题)。

Comment thread internal/tui/core/app/update.go
Copy link
Copy Markdown
Collaborator

@phantom5099 phantom5099 Apr 28, 2026

Choose a reason for hiding this comment

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

这个是在做文件的模糊匹配吗?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

dui怼

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个应该放在这里吗,那到时候其他端需要重写一套一样的逻辑吗

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

确实应该做拆分复用,主要是不能强耦合,但是他写的是tui/services,可以问问能不能复用

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个是在做路径的模糊搜索吗

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这是精准黑名单skip

Comment thread internal/tui/core/app/update.go Outdated
}

// maybeStartModelScopeGuideFromProvider 在选择 modelscope 且未配置 token 时进入半引导流程。
// maybeStartModelScopeGuideFromProvider 鍦ㄩ€夋嫨 modelscope 涓旀湭閰嶇疆 token 鏃惰繘鍏ュ崐寮曞娴佺▼銆?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

注释乱码解决一下

Comment thread internal/tui/core/app/update.go Outdated
}

// resolveModelScopeGuidePath 解析 ModelScope 指导页的本地路径;文件不存在时返回空字符串。
// resolveModelScopeGuidePath 瑙f瀽 ModelScope 鎸囧椤电殑鏈湴璺緞锛涙枃浠朵笉瀛樺湪鏃惰繑鍥炵┖瀛楃涓层€?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

同上

Comment thread internal/tui/core/app/update.go Outdated
Comment on lines +1672 to +1673
"闇€瑕佸疄鍚嶈璇?",
"实名认证",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个Update里面的所有中文都是乱的,记得修改

@Cai-Tang-www Cai-Tang-www self-requested a review April 28, 2026 03:40
Copy link
Copy Markdown
Collaborator

@Cai-Tang-www Cai-Tang-www left a comment

Choose a reason for hiding this comment

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

Major:跨端能力被实现成 TUI 私有逻辑,后续客户端必然重复造轮子
现在文件匹配排序核心放在 file_service.go (line 29) 的 SuggestFileMatches(filenameMatchBoost=1000、路径/文件名双通道打分)。
这意味着 Web/桌面/外部客户端如果要一致体验,只能各自再实现一遍,行为会漂移。

Major:工作区扫描策略也在 TUI infra,属于客户端侧“规则下沉”
workspace_files.go (line 12) 的扫描与目录黑名单(含新增 .build)在 TUI 层定义。
这本质是“候选集生成规则”,不是纯渲染逻辑。多客户端会出现不同黑名单/结果集。

Major:PR 里的“运行中用户介入”也是 TUI 局部能力,不是网关/运行时能力
update.go (line 499) 里是 queueInterventionInput + CancelActiveRun 的本地状态机。
终端可用,但其他客户端不会天然获得同样语义(除非再复制一套)。

@creatang
Copy link
Copy Markdown
Collaborator Author

对于上述的问题实现可能需要在runtime进行编排 @pionxe

先抽“能力接口”,再迁实现
把“文件候选 + 排序”定义成 runtime/gateway 能力(例如 SearchWorkspaceFiles),TUI 只负责展示。

扫描策略上移并配置化
黑名单、深度、忽略规则进入统一配置(runtime 读取),TUI 不再内置规则。

介入语义协议化
新增统一事件/命令:enqueue_intervention、run_canceling、intervention_queued、intervention_dispatched,各客户端只消费状态,不自建状态机。

@phantom5099
Copy link
Copy Markdown
Collaborator

对于上述的问题实现可能需要在runtime进行编排 @pionxe

先抽“能力接口”,再迁实现 把“文件候选 + 排序”定义成 runtime/gateway 能力(例如 SearchWorkspaceFiles),TUI 只负责展示。

扫描策略上移并配置化 黑名单、深度、忽略规则进入统一配置(runtime 读取),TUI 不再内置规则。

介入语义协议化 新增统一事件/命令:enqueue_intervention、run_canceling、intervention_queued、intervention_dispatched,各客户端只消费状态,不自建状态机。

嗯,目前的话先这么操作吧

@phantom5099 phantom5099 merged commit 4d168b0 into 1024XEngineer:main Apr 28, 2026
2 of 3 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