fix issue#21

This commit is contained in:
锦恢 2025-06-01 22:20:21 +08:00
parent 6ab0c789b4
commit 7b3daacdf5
5 changed files with 24 additions and 7 deletions

View File

@ -1,5 +1,9 @@
# Change Log
## [main] 0.1.3
- 解决 issue#21 点击按钮后的发送文本后不会清空当前的输入框。
- 修复暂停按键在多轮对话后消失的问题。
## [main] 0.1.2
- 新特性:用户发送的信息增加「重新发送」按钮。
- 支持特性 issue#17 「关于左侧添加mcp服务器操作优化问题」增加强制聚焦功能用户创建mcp服务器连接的过程中不会让输入框失去焦点。

View File

@ -2,7 +2,7 @@
"name": "openmcp",
"displayName": "OpenMCP",
"description": "An all in one MCP Client/TestTool",
"version": "0.1.2",
"version": "0.1.3",
"publisher": "kirigaya",
"author": {
"name": "kirigaya",

View File

@ -4,6 +4,7 @@
<div class="input-wrapper">
<KRichTextarea
:ref="el => editorRef = el"
:tabId="tabId"
v-model="userInput"
:placeholder="t('enter-message-dot')"
@ -43,6 +44,7 @@ const props = defineProps({
});
const emits = defineEmits(['update:scrollToBottom']);
const editorRef = ref<any>(null);
const tab = tabs.content[props.tabId];
const tabStorage = tab.storage as ChatStorage;
@ -84,6 +86,7 @@ function clearErrorMessage(errorMessage: string) {
}
function handleSend(newMessage?: string) {
//
const userMessage = newMessage || userInput.value;
@ -115,8 +118,6 @@ function handleSend(newMessage?: string) {
}
});
}
isLoading.value = false;
});
loop.registerOnChunk(() => {
@ -124,7 +125,6 @@ function handleSend(newMessage?: string) {
});
loop.registerOnDone(() => {
isLoading.value = false;
scrollToBottom();
});
@ -133,9 +133,16 @@ function handleSend(newMessage?: string) {
scrollToBottom();
});
loop.start(tabStorage, userMessage);
loop.start(tabStorage, userMessage).then(() => {
isLoading.value = false;
});
//
userInput.value = '';
const editor = editorRef.value.editor;
if (editor) {
editor.innerHTML = '';
}
}
function handleAbort() {

View File

@ -117,6 +117,12 @@ function extractTextFromCollection(collection: HTMLCollection) {
const isComposing = ref(false);
defineExpose({
editor,
handleBackspace,
handleInput,
});
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Enter' && !event.shiftKey && !isComposing.value) {

View File

@ -6,7 +6,7 @@
</span>
<p>
OpenMCP Client 0.1.2 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
OpenMCP Client 0.1.3 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
</p>
<p>