qwen-code/docs/design
顾盼 b55b52543a
feat(cli): improve slash command discovery (#3736)
* feat(cli): improve slash command discovery

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* test(cli): update input prompt completion expectations

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* fix(cli): address review feedback on slash command phase 3

- Fix getBestSlashCommandMatch sort order: completionPriority first,
  recentOrder second — consistent with compareRankedCommandMatches in
  useSlashCompletion.ts so ghost text and dropdown agree on best match

- Fix findSlashCommandTokens to index altNames into commandMap so alias
  tokens (e.g. /usage for /stats) are highlighted as valid instead of
  being marked invalid

- Fix getRecentScore decay formula: 10 * Math.max(0, 1 - ageMs /
  RECENT_DECAY_MS) so the recent boost truly decays to 0 within the
  10-minute window named by RECENT_DECAY_MS

- Fix Help.tsx CommandsHelp scroll indicator to show command count
  range (e.g. 1-12/49) instead of raw line count (18/108), which was
  confusing because each command expands into 2-3 render lines

- Fix Help.tsx CommandLine key prop: use stable type:text:index key
  instead of scrollOffset-index to avoid remounting every line on scroll

- Internationalize Help.tsx tab labels via t() instead of hardcoded
  English strings

- Add Tab/Shift+Tab to switch tabs hint in Help footer alongside Esc

- Add commandMetadata.test.ts with full branch coverage for all 6
  exported functions (getCommandSourceBadge, getCommandSourceGroup,
  formatSupportedModes, getCommandDisplayName, getCommandSubcommandNames,
  formatCommandSourceLabel)

- Add direct unit tests for getBestSlashCommandMatch covering: null on
  empty input, null on no match, null for non-modelInvocable commands,
  completionPriority ordering, recentCommands tie-breaking, argumentHint
  return path, exact-match exclusion without hint, inclusion with hint

- Update Session.test.ts expectation for sendAvailableCommandsUpdate to
  include _meta field that was added in this PR

* test(cli): add missing test coverage for slash completion

- Add test: midInputGhostText is null when only non-modelInvocable commands match
- Add test: recentCommands boosts non-root prefix suggestions via recentScore

Both tests address coverage gaps identified in code review.

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 14:25:44 +08:00
..
adaptive-output-token-escalation fix(core): recover from truncated tool calls via multi-turn continuation (#3313) 2026-04-21 17:04:24 +08:00
auth refactor(cli): provider-first auth registry with unified install pipeline (#3864) 2026-05-08 12:19:28 +08:00
auto-memory feat(memory): managed auto-memory and auto-dream system (#3087) 2026-04-16 20:05:45 +08:00
channels docs(channels): consolidate design docs into single file 2026-04-02 11:17:37 +08:00
compact-mode feat: optimize compact mode UX — shortcuts, settings sync, and safety (#3100) 2026-04-16 09:29:24 +08:00
customize-banner-area feat(cli): customize banner area (logo, title, hide) (#3710) 2026-05-07 10:17:53 +08:00
fork-subagent feat(core): implement fork subagent for context sharing (#2936) 2026-04-14 14:27:38 +08:00
prompt-suggestion fix(followup): prevent tool call UI leak and Enter accept buffer race (#2872) 2026-04-09 00:07:03 +08:00
session-recap fix(cli): rework session recap rendering and add blur threshold setting (#3482) 2026-04-21 14:39:13 +08:00
session-title feat(session): auto-title sessions via fast model, add /rename --auto (#3540) 2026-04-23 20:37:05 +08:00
skill-nudge feat(memory): add autoSkill background project skill extraction (#3673) 2026-05-09 14:25:02 +08:00
slash-command feat(cli): improve slash command discovery (#3736) 2026-05-09 14:25:44 +08:00
tool-use-summary fix(cli): add API Key option to qwen auth interactive menu (#3624) 2026-04-27 22:01:47 +08:00
markdown-syntax-extension.md feat(cli): expand TUI markdown rendering (#3680) 2026-05-07 16:24:13 +08:00
openrouter-auth-and-models.md Feat/openrouter auth (#3576) 2026-04-27 14:47:44 +08:00