qwen-code/packages
易良 04afc610ea
fix(vscode-companion): slash command completion not triggering after message submit (#3609)
* fix(vscode-companion): slash command completion not triggering after message submit

After submitting a message, the input field is cleared with a zero-width
space (\u200B) to maintain contentEditable height. When the user then
types "/", the DOM content becomes "\u200B/" and the trigger character
lands at position 1 instead of 0. The word boundary check only recognized
regular space and newline, so the zero-width space was rejected as an
invalid boundary — preventing the completion popup from appearing.

Add \u200B to the valid word boundary characters so "/" and "@" triggers
work correctly after message submission without requiring an extra
backspace.

Closes #3592

* refactor(webui): extract zero-width space placeholder into shared constant

Replace scattered `\u200B` magic strings with a shared `ZERO_WIDTH_SPACE`
constant and `stripZeroWidthSpaces()` helper exported from @qwen-code/webui.

This also improves the slash command completion fix: instead of adding
\u200B to the word boundary check, strip it at the source in handleInput
(consistent with InputForm's onInput handler) and clamp the cursor
position to the stripped text length.

Closes #3592

* test: add tests for zero-width space handling and shouldSendMessage

- Add unit tests for ZERO_WIDTH_SPACE constant and stripZeroWidthSpaces
  helper (via @qwen-code/webui import)
- Add shouldSendMessage tests covering empty, whitespace, zero-width
  space, and attachment scenarios
- Add parseExportSlashCommand tests for zero-width space input

* fix(test): use correct ImageAttachment type in shouldSendMessage tests

Fix CI lint failure by providing all required ImageAttachment fields
(id, name, type, size, data, timestamp) instead of non-existent
mediaType property.
2026-04-26 22:27:54 +08:00
..
channels chore(release): bump version to 0.15.2 (#3596) 2026-04-24 19:55:12 +08:00
cli feat: Adds Catalan language support (#3643) 2026-04-26 22:26:53 +08:00
core fix(core): match DeepSeek provider by model name for sglang/vllm (#3613) (#3620) 2026-04-26 13:17:34 +08:00
sdk-java fix(sdk-java): pass custom env to CLI process (#3543) 2026-04-24 10:37:52 +08:00
sdk-python feat(SDK) Add Python SDK implementation for #3010 (#3494) 2026-04-25 07:02:58 +08:00
sdk-typescript feat(web-search): remove built-in web_search tool, replace with MCP-based approach (#3502) 2026-04-24 11:29:02 +08:00
vscode-ide-companion fix(vscode-companion): slash command completion not triggering after message submit (#3609) 2026-04-26 22:27:54 +08:00
web-templates chore(release): bump version to 0.15.2 (#3596) 2026-04-24 19:55:12 +08:00
webui fix(vscode-companion): slash command completion not triggering after message submit (#3609) 2026-04-26 22:27:54 +08:00
zed-extension chore(zed-extension): update package version to 0.10.0 2026-02-06 14:26:01 +08:00