Skip to content

feat(chat): fuzzy subsequence match for slash commands#368

Merged
xintaofei merged 2 commits into
xintaofei:mainfrom
asxuen:feat/slash-fuzzy-match
Jul 22, 2026
Merged

feat(chat): fuzzy subsequence match for slash commands#368
xintaofei merged 2 commits into
xintaofei:mainfrom
asxuen:feat/slash-fuzzy-match

Conversation

@asxuen

@asxuen asxuen commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace substring-only / command (and $ skill) filtering with ranked fuzzy matching: exact → prefix → substring → subsequence.
  • Lets inputs like /bmadhelp and /bmhp match hyphenated command names such as bmad-help.
  • Shared helper used by chat composer, + slash dropdown, and automation editor menus.

Test plan

  • Unit tests: pnpm exec vitest run src/lib/fuzzy-text-match.test.ts
  • In chat input, type /bmadhelp and /bmhp and confirm bmad-help appears
  • Empty / still lists all commands in original order
  • Exact/prefix hits rank above pure subsequence matches
  • + → Slash commands search and automation editor / behave the same

asxuen and others added 2 commits July 22, 2026 15:51
Replace substring-only filtering so inputs like /bmadhelp and /bmhp can
match hyphenated names (e.g. bmad-help), with ranked exact/prefix/
substring/subsequence scoring shared across chat and automation menus.
The exact/prefix/subsequence ordering test collapsed onto one line under
prettier, failing CI; rewrite it to assert the full tier order (adding the
missing prefix case) and add coverage for the primary-over-secondary
guarantee, stable-sort tie ordering, and empty-primary handling.
@xintaofei

Copy link
Copy Markdown
Owner

感谢佬的PR

@xintaofei
xintaofei merged commit f918137 into xintaofei:main Jul 22, 2026
7 checks passed
xintaofei added a commit that referenced this pull request Jul 22, 2026
- feat(git): **The branch selector moves below the composer, with a rebuilt dropdown.** It now mounts per conversation, and its dropdown is a searchable, virtualized list combining git operations with prefix-grouped local and remote branches — each offering switch, merge, rebase, and delete.
- feat(chat): **Context usage and connection status move below the composer, per conversation.** The context gauge and a color-coded connection heart now sit beneath each composer, so tiled views show their own state.
- feat(acp): **Diagnose why an installed agent still reads "not installed."** A read-only report checks Node/npm, the npm prefix, your PATH, and each agent's launchability, names the likely cause, and copies it all in one click. Open it from Agent Settings or the composer's not-installed banner.
- feat(chat): **Slash commands match by fuzzy subsequence.** Typing `/bmadhelp` or `/bmhp` now finds `bmad-help`, across both the chat and automation menus. Thanks to @asxuen (#368).
- feat(chat): **Changed files in a reply open on click.** Changed-file rows now render as cards that open in the workspace tabs, with a reveal-in-folder button.
- feat(sidebar): **The locate-conversation button moves to the sidebar header,** beside the view-options funnel.
- fix(chat): **A copied URL pastes as its address, not the page title.** Links copied from a browser's address bar now keep the URL, while text copied within the editor still round-trips intact.
- fix(kimi): **Kimi's context gauge no longer jams at 100%.** It now reads occupancy from the latest step instead of summing every step's cached prefix; cumulative token totals are unchanged.
- fix(chat): **No more stacked placeholder tool cards while streaming.** Empty in-flight polls are skipped until a real id or result arrives.
- fix(acp): **Install logs keep non-UTF-8 error text,** so localized OS errors (e.g. GBK on Chinese Windows) no longer truncate the log or blank the failure detail.
- fix(acp): **The composer catches up when an install is detected,** refreshing from "not installed" as soon as the Settings probe records a version.
- fix(sidebar): **The Folders section stays visible when nothing is open,** showing an empty hint instead of disappearing.

-----------------------------

# 发布版本 0.21.5

- 功能(Git):**分支选择器移到输入框下方,并重建了下拉菜单。** 现在按会话挂载,下拉菜单是一个可搜索、虚拟化的列表,把 git 操作与按前缀分组的本地、远程分支合并在一起,每个分支都提供切换、合并、变基与删除。
- 功能(聊天):**上下文用量与连接状态移到输入框下方,并按会话区分。** 上下文用量表与一颗按状态着色的连接心形图标现在位于各自输入框下方,因此平铺视图各自显示自己的状态。
- 功能(智能体):**诊断为什么已安装的智能体仍显示「未安装」。** 一份只读报告会检查 Node/npm、npm 前缀、你的 PATH 与每个智能体能否启动,指出最可能的原因,并一键复制全部。可从智能体设置或输入框的未安装横幅打开。
- 功能(聊天):**斜杠命令支持模糊子序列匹配。** 现在输入 `/bmadhelp` 或 `/bmhp` 就能找到 `bmad-help`,聊天与自动化菜单均适用。感谢 @asxuen 的贡献(#368)。
- 功能(聊天):**回复中的变更文件点击即可打开。** 变更文件行现在渲染为卡片,点击即在工作区标签中打开,并带有在文件夹中显示的按钮。
- 功能(侧边栏):**定位会话按钮移至侧边栏头部,** 紧邻显示选项漏斗。
- 修复(聊天):**复制的网址粘贴为地址本身,而非页面标题。** 从浏览器地址栏复制的链接现在会保留网址,而在编辑器内复制的文本仍完整还原。
- 修复(Kimi):**Kimi 的上下文用量表不再卡在 100%。** 现在按最新一步读取占用,而不再累加每一步的缓存前缀;累计 token 总量保持不变。
- 修复(聊天):**流式过程中不再堆叠占位的工具卡片。** 进行中的空轮询会被跳过,直到真正的 id 或结果到达。
- 修复(智能体):**安装日志保留非 UTF-8 的错误文本,** 因此本地化的系统错误(例如中文 Windows 上的 GBK)不再截断日志或让失败详情为空。
- 修复(智能体):**检测到安装后,输入框会随之更新,** 一旦设置页探测记录到版本,就从「未安装」立即刷新。
- 修复(侧边栏):**没有打开文件夹时,「文件夹」区块仍然可见,** 显示一条空状态提示而非直接消失。
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.

2 participants