feat(tui): redesign AskUserQuestion panel, layout, focus and result display - #48
Open
LIUXIN557 wants to merge 6 commits into
Open
feat(tui): redesign AskUserQuestion panel, layout, focus and result display#48LIUXIN557 wants to merge 6 commits into
LIUXIN557 wants to merge 6 commits into
Conversation
added 5 commits
September 9, 2026 16:15
…splay 真实交互验收后修正 TUI 问答界面的 11 项问题,并补上 ask.max_questions 的收尾。 面板几何与着色: - 面板改为聊天视口底部定高浮层,四边不再越出聊天区 - 只给边框着色(borderStyled),不再对容器整体 color(),面板外聊天内容不再被染色 - 面板绘制前对自身矩形做字符级擦除(clear_under),聊天文字不再从空单元格透出 - 移除面板内的全局状态行,模型切换等通知只留在标题/状态区 选项与汇总排版: - 选项页改为编号列/标记列/标题列/说明列四个固定槽位,列间距 2 个 ASCII 空格,标题列按最长标题收紧 - 自定义行与其他选项共用列边界并显示单选/多选标记 - 已选行不再有底色,只有焦点行有底色,且焦点不改变字重与字色 - 题目白色加粗、答案白色不加粗、说明灰色不加粗 - 汇总页与转录按“问题:答案”成对输出,答案列左对齐、块内顶部对齐、块间空行 光标与帮助: - 终端光标绑定到自定义文本真实插入点,不再由整块面板抢占 - 帮助区改为“键名: 功能”分层片段并使用真实按键符号,保留固定最小行数以免状态切换带动面板位移 结果展示与参数隐藏: - AskUserQuestion 不再生成通用参数摘要,TUI 走专用问答结果分支 - 历史会话恢复时忽略旧的不安全摘要,避免 question/header/options/multiSelect 泄漏 顺带修复: - 窄宽度折行的零进度死循环(曾退化为 bad_alloc) - 折行保持 ASCII 单词完整,行首不出现收尾标点 - agent_loop interrupted 分支解引用空 optional 新增 src/tui/ask_question_panel.* 渲染层(颜色注入,可逐格断言)。问答相关 118 项测试通过,全量 3920 项通过(2 项为既有基线/环境失败)。 OpenSpec: openspec/changes/redesign-tui-ask-user-question (tasks 6.x, 7.x)
- daemon_pool: check executables exist before std::filesystem::equivalent, so a missing expected executable is consistently Unsafe across platforms. - pty_shell: only fall back to generic /bin/sh when no named shell (bash/zsh/fish) is available, so a broken login shell falls back to bash. - toolchains_test: guard the Windows-path DetectsDirectories case with _WIN32 since backslash is not a POSIX path separator.
Collaborator
Author
CI 单元测试失败分析(unit-tests / linux-x64)ctest 汇总:4105 个测试中 3 个失败(exit code 8)。三个失败点均位于本 PR 未改动的模块(daemon_pool / terminal_resolver / toolchains),与 AskUserQuestion TUI 重构无关,属于基础分支上既有的测试环境 / 测试预期偏差。 1. DaemonPool.InstallationCompatibilityRequiresSameVersionAndExecutable
2. TerminalResolverPosixTest.BrokenLoginShellFallsBackToBash
3. ToolchainsDetectTest.DetectsDirectoriesAndSkipsStoreStub
修复(已合入本分支,commit dfebe5c)
Windows 侧 39 个相关用例已回归通过;Linux 侧行为需 CI 再次确认。 |
更新 PR #48 到当前 master 基线,并解决提问通道与主题确认的兼容问题。 修复滚动条命中、手动滚动、光标可见性、自定义答案选择和多行显示、 空首行编辑、窄屏汇总点击、双击 Esc 及大整数配置钳制。 同步主题通道测试,补齐轮次切换测试的请求开始前置条件。 验证:183 项定向测试通过;TUI 与 Desktop 构建通过;OpenSpec 严格验证通过。 全量 CTest 已运行,固定端口和临时目录竞争的失败项串行复查通过。 既有子任务测试断言通过但进程收尾超时,在原 Release 构建中同样复现。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
完成 TUI
AskUserQuestion重设计的收尾,并修正真实交互验收中发现的 11 项界面问题。同时带入ask.max_questions跨端配置。已并入最新
master(v0.9.14,29 个提交),无冲突。面板几何与着色
borderStyled),不再对容器整体color()—— 这是「整个对话区变蓝」的根因。clear_under)。只设背景色不会擦掉下层字符,聊天文字会从面板没写字的格子透出来(表现为POSTto d、行尾多出(openai/…))。选项与汇总排版
( )/(*)、[ ]/[x])。问题:答案成对输出:两列块顶部对齐、所有答案共用同一左边界、块间空一行、短问题在列内补齐;宽度不足时降级为上下堆叠。光标与帮助
↑↓ ←→ Enter Esc Space Tab Ctrl+Enter PgUp/PgDn,并保留固定最小行数,避免状态切换带动面板位移。结果展示与参数隐藏
AskUserQuestion不再生成通用参数摘要;TUI 对问答结果走专用展示分支,Ctrl+E/Ctrl+O都不会把它切回参数 JSON。question/header/options/description/multiSelect不再泄漏到转录。序号. 问题:答案,问题始终与答案成对出现。顺带修复的真实缺陷
bad_alloc(原窄终端用例曾耗时 127s 后抛异常)。,。?!:、;等收尾标点。agent_loop.cppinterrupted 分支解引用空optional。结构调整
src/tui/ask_question_panel.{hpp,cpp}:overlay 绘制层,颜色由调用方注入,因此可以用 FTXUIScreen逐格断言位置与颜色,而不是只测字符串。ask_question_layout的行模型改为按列保存文本并携带列偏移,渲染端不再自行推算列宽。验证
master后全量 4118 项通过。clear_under时确认变红)、列对齐与标记、焦点不改字重、光标坐标(空/有文本)、汇总两列对齐与堆叠降级、参数名隐藏、帮助分层与固定高度、单选取消选中、点击自定义行进入行内编辑。verify-package --target tui13/13 PASS(staged 包内 models.dev 与 seed 资源校验通过)。与本改动无关的既有失败
AgentLoopGoal.ResumeAfterAbortClearsStaleAbortAndContinues:turn_count >= 2时序竞态。已做对照实验——临时还原本改动对该文件的唯一修改后重编译,仍同样失败。TcpProbe.TimeoutOnUnreachableHost:依赖「不可达主机」的网络前提,本机探测返回 Ok,属环境问题。OpenSpec
openspec/changes/redesign-tui-ask-user-question/(tasks 6.x / 7.x 已按完成情况勾选),需求文档同步更新:docs/specs/2026-09-07-tui-ask-user-question-requirements.md。