完善对话页面!

* 消息组件显示移植
* 最近对话直接打开的补充
* 提及的修补
* ......
This commit is contained in:
CrescentLeaf
2026-01-01 19:39:04 +08:00
parent 722b06c018
commit ba97ea359a
6 changed files with 330 additions and 17 deletions

View File

@@ -44,7 +44,10 @@ export default function ChatFragment({
const inputRef = React.useRef<TextField>()
const chatPagePanelRef = React.useRef<ChatPanelRef>()
async function performSendMessage() {
await chatInfo.sendMessageOrThrow(inputRef.current!.value)
inputRef.current!.value = ''
}
return (
<div style={{
@@ -164,6 +167,7 @@ export default function ChatFragment({
}} onKeyDown={(event: KeyboardEvent) => {
if (event.ctrlKey && event.key == 'Enter') {
// 发送消息
performSendMessage()
}
}} onPaste={(event: ClipboardEvent) => {
for (const item of event.clipboardData?.items || []) {
@@ -185,11 +189,7 @@ export default function ChatFragment({
}}></mdui-button-icon>
<mdui-button-icon icon="send" style={{
marginRight: '7px',
}} onClick={async () => {
// 发送消息
await chatInfo.sendMessageOrThrow(inputRef.current!.value)
inputRef.current!.value = ''
}}></mdui-button-icon>
}} onClick={performSendMessage}></mdui-button-icon>
<div style={{
display: 'none'
}}>