Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

style: update ChatInput

canisminor199073b773260bb4
diff --git a/src/app/[variants]/(main)/home/features/InputArea/index.tsx b/src/app/[variants]/(main)/home/features/InputArea/index.tsx
index 9414d2d8425..6f1873fe677 100644
--- a/src/app/[variants]/(main)/home/features/InputArea/index.tsx
+++ b/src/app/[variants]/(main)/home/features/InputArea/index.tsx
@@ -44,6 +44,7 @@ const InputArea = () => {
<DragUploadZone onUploadFiles={handleUploadFiles}>
<ChatInputProvider
agentId={inboxAgentId}
+ allowExpand={false}
chatInputEditorRef={(instance) => {
if (!instance) return;
useChatStore.setState({ mainInputEditor: instance });
diff --git a/src/features/ChatInput/ChatInputProvider.tsx b/src/features/ChatInput/ChatInputProvider.tsx
index b038ddb8379..5c014220896 100644
--- a/src/features/ChatInput/ChatInputProvider.tsx
+++ b/src/features/ChatInput/ChatInputProvider.tsx
@@ -21,6 +21,7 @@ export const ChatInputProvider = memo<ChatInputProviderProps>(
chatInputEditorRef,
onMarkdownContentChange,
mentionItems,
+ allowExpand,
}) => {
const editor = useEditor();
const slashMenuRef = useRef<HTMLDivElement>(null);
@@ -29,6 +30,7 @@ export const ChatInputProvider = memo<ChatInputProviderProps>(
<Provider
createStore={() =>
createStore({
+ allowExpand,
editor,
leftActions,
mentionItems,
@@ -42,6 +44,7 @@ export const ChatInputProvider = memo<ChatInputProviderProps>(
>
<StoreUpdater
agentId={agentId}
+ allowExpand={allowExpand}
chatInputEditorRef={chatInputEditorRef}
leftActions={leftActions}
mentionItems={mentionItems}
diff --git a/src/features/ChatInput/StoreUpdater.tsx b/src/features/ChatInput/StoreUpdater.tsx
index 7bdbdfb7d86..4739c204fa0 100644
--- a/src/features/ChatInput/StoreUpdater.tsx
+++ b/src/features/ChatInput/StoreUpdater.tsx
@@ -22,6 +22,7 @@ const StoreUpdater = memo<StoreUpdaterProps>(
onMarkdownContentChange,
sendMenu,
mentionItems,
+ allowExpand,
}) => {
const storeApi = useStoreApi();
const useStoreUpdater = createStoreUpdater(storeApi);
@@ -33,6 +34,7 @@ const StoreUpdater = memo<StoreUpdaterProps>(
useStoreUpdater('mentionItems', mentionItems);
useStoreUpdater('leftActions', leftActions!);
useStoreUpdater('rightActions', rightActions!);
+ useStoreUpdater('allowExpand', allowExpand);
useStoreUpdater('sendButtonProps', sendButtonProps);
useStoreUpdater('onSend', onSend);