CodePilot icon indicating copy to clipboard operation
CodePilot copied to clipboard

v0.50.1 斜杠命令会清空输入框已有内容

Open KevinYoung-Kw opened this issue 7 months ago • 1 comments

使用版本:CodePilot v0.50.1 运行环境:macOS 15.2 (Darwin 25.2.0) / Apple Silicon

Image

问题描述 在输入框中已经输入了一段文字后,如果选择带有 "Add details(optionals)" 的斜杠命令,输入框内的所有内容会被直接清空。

期望行为 已有文本应自动作为 details 内容填充,而不是被清空。

KevinYoung-Kw avatar Apr 15 '26 03:04 KevinYoung-Kw

感谢反馈!已通过 #486 修复合进 main,感谢 @KevinYoung-Kw 的 PR。

根因:resolveItemSelection 返回 set_badge 时没带 newInputValue,调用方硬编码 setInputValue('') 把触发位前后的用户输入一并清掉。修法是在 message-input-logic.ts 的 set_badge 分支里计算 before+after 的保留文本返回给 useSlashCommands,选中 badge 命令后原有文字保留、光标自动定位到末尾,方便继续补 details。immediate 类命令(/clear、/help 等)行为不变。

下次发版会带上这个修复。

op7418 avatar Apr 15 '26 09:04 op7418