From f00534e76a72ecad9d9eb38fca9cbbae715921bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 16 Jul 2026 13:18:09 +0800 Subject: [PATCH] simplify draft state --- .../components/RichInputArea/attachment.tsx | 3 +- .../RichInputArea/attachmentContext.tsx | 1 - .../home/components/RichInputArea/index.tsx | 69 +++++++++++-------- .../RichInputArea/richTextToPrompt.tsx | 29 ++++---- .../src/view/home/index.tsx | 24 +++---- .../src/view/home/useHomeDraftStore.ts | 32 ++------- 6 files changed, 72 insertions(+), 86 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/home/components/RichInputArea/attachment.tsx b/apps/ai-game-creator-shell/src/view/home/components/RichInputArea/attachment.tsx index ddb5f34f2..41bffc9a0 100644 --- a/apps/ai-game-creator-shell/src/view/home/components/RichInputArea/attachment.tsx +++ b/apps/ai-game-creator-shell/src/view/home/components/RichInputArea/attachment.tsx @@ -13,7 +13,7 @@ export function AttachmentToken({ nodeKey: NodeKey; }) { const [editor] = useLexicalComposerContext(); - const { attachments, removeAttachment } = useContext(AttachmentContext); + const { attachments } = useContext(AttachmentContext); const attachment = attachments.get(attachmentId); if (!attachment) { return null; @@ -29,7 +29,6 @@ export function AttachmentToken({ editor.update(() => { $getNodeByKey(nodeKey)?.remove(); }); - removeAttachment(attachmentId); }} >