feat(tui): slash 提示分层——空 query 只展示核心命令层,继续输入即过滤全量 - #45
Closed
yq04 wants to merge 1 commit into
Closed
Conversation
问题:提示列表 65 条静态 + 动态 skills ≈ 80 条,输入恰好 / 时按定义序 展示(前 5 条 + 滚动),普通用户在噪音墙里发现不了常用命令。 方案(发现性分层,不删任何命令): - PaletteCommand/SlashHintEntry 加 tier: 'core',21 条高频命令标注 (/help /queue /compact /model /tasks /clear /sessions /permission /yes /theme /handoff /effort /team /scout /plan /review /init /exit /doctor + 新增 /undo /resume) - filterSlashCommands 空 query 返回核心层(无 core 标注的清单回退全量, 兼容纯 skills 形态);带任意字符走全量评分过滤(现有排序不变)。 键导航/Tab 补全/渲染三处共用该函数,单点分层即整体一致 - footer 引导:'核心 N/M · 输入即过滤全部 · ctrl+p 面板'——不藏进阶 命令的存在,给出明确出口 - /undo(检查点回滚)、/resume(会话选择器)原为有实现无提示的隐藏 命令,补进 palette 并标 core——高频救命功能用户本发现不了 - README 斜杠命令段补分层说明 新增 slash-tier-hints.test.ts 6 条契约(纯函数 5 + 端到端 1), 干净基线 4 RED / 修复后 6 GREEN;tui 域回归失败集合与基线一致 (Windows 预存在问题),零新增失败。
Owner
|
已回合 dev 主线(cherry-pick 保留作者署名): 验证:typecheck 通过;新增 slash-tier-hints 6 条契约全绿;TUI 域 2213 测试 0 失败;与 #41(Ctrl+P 面板)的组合已联合验证。 内容将随下次 sync 进入公开仓 main。「发现性分层而非删命令」的取舍 + 补进隐藏的 /undo、/resume,以及审查发现里留下的空壳/子命令单列问题,都是有价值的沉淀。 |
huiliyi37
added a commit
that referenced
this pull request
Aug 17, 2026
排队消息语义对齐 / 命令面板 Ctrl+P 换绑 / Ctrl+C 退出确认可取消 / 跨 run 陈旧 todo 清单不复活 / slash 提示核心层分层。均附根因分析与 RED→GREEN 测试基线,随 v3.4.0 发布。 Co-authored-by: yq04 <143403280+yq04@users.noreply.github.com>
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.
问题
slash 命令提示列表 65 条静态命令 + 动态 skills ≈ 80 条。输入恰好
/(空 query)时按定义序展示(前 5 条 + 滚动),普通用户在噪音墙里发现不了常用命令——「命令太多,无法轻松察觉,容易造成冗余」。方案:发现性分层(不删任何命令)
审查全量清单后选择分层而非删除——空壳/子命令单列等问题另行处理,本 PR 只解决「发现性」:
核心机制:
PaletteCommand/SlashHintEntry增加tier: 'core',21 条高频命令标注(/help/queue/compact/model/tasks/clear/sessions/permission/yes/theme/handoff/effort/team/scout/plan/review/init/exit/doctor+ 新增/undo/resume)filterSlashCommands空 query 返回核心层;继续输入任意字符即过滤全部命令(现有评分排序不变),Ctrl+Esc 面板永远全量模糊搜索核心 N/M · 输入即过滤全部 · ctrl+p 面板——不藏进阶命令的存在,给出明确出口core标注的清单(如纯 skills 形态)回退全量——分层是增强不是破坏单点分层:键导航(↑↓ 循环)/ Tab 补全 / 渲染三处共用
filterSlashCommands,在此一处生效即整体一致——导航所见即补全所得。顺带修复「该露的没露」:
/undo(检查点文件回滚,支持序号/preview)与/resume(无参会话选择器)是有完整实现但从未进提示列表的隐藏命令——高频救命功能用户发现不了,本 PR 补进 palette 并标核心层。审查发现(未在本 PR 处理,供后续讨论)
/task(已自认废弃)、/chat(描述「切换轻量聊天模式」但 handler 只弹「已自动检测」提示——描述与行为不符)/model list、/team max、/review max|off、/skill ×5)可并入主条目/write-plan为/plan纯别名占提示位测试
新增
slash-tier-hints.test.ts6 条契约:/显示核心层(/model 可见、/btw 不可见),继续输入b切换全量过滤验证:干净基线 4 RED / 修复后 6 GREEN;tui 域 2271 测试回归,失败集合与上游基线完全一致(Windows 预存在问题),零新增失败;改动域 typecheck 零错误。