Skip to content

Commit cf3f2af

Browse files
authored
fix: history list height (#550)
* fix: history list height * docs: update notes
1 parent 401832a commit cf3f2af

4 files changed

Lines changed: 49 additions & 47 deletions

File tree

docs/content.en/docs/release-notes/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Information about release notes of Coco Server is provided here.
4040
- fix: panic when fetching app metadata on Windows #538
4141
- fix: service switching error #539
4242
- fix: switch server assistant and session unchanged #540
43+
- fix: history list height #550
4344

4445
### ✈️ Improvements
4546

src/components/Assistant/Chat.tsx

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const ChatAI = memo(
7676
const { curChatEnd, setCurChatEnd, connected, setConnected } =
7777
useChatStore();
7878

79-
const isCurrentLogin = useAuthStore(state => state.isCurrentLogin);
79+
const isCurrentLogin = useAuthStore((state) => state.isCurrentLogin);
8080

8181
const visibleStartPage = useConnectStore((state) => {
8282
return state.visibleStartPage;
@@ -164,7 +164,7 @@ const ChatAI = memo(
164164
isMCPActive,
165165
changeInput,
166166
websocketSessionId,
167-
showChatHistory,
167+
showChatHistory
168168
);
169169

170170
const { dealMsg } = useMessageHandler(
@@ -320,10 +320,7 @@ const ChatAI = memo(
320320
);
321321

322322
return (
323-
<div
324-
data-tauri-drag-region
325-
className={`flex flex-col rounded-md relative h-full overflow-hidden`}
326-
>
323+
<>
327324
{showChatHistory && !setIsSidebarOpen && (
328325
<ChatSidebar
329326
isSidebarOpen={isSidebarOpenChat}
@@ -336,49 +333,53 @@ const ChatAI = memo(
336333
onRename={renameChat}
337334
/>
338335
)}
339-
340-
<ChatHeader
341-
clearChat={clearChat}
342-
onOpenChatAI={openChatAI}
343-
setIsSidebarOpen={toggleSidebar}
344-
isSidebarOpen={isSidebarOpenChat}
345-
activeChat={activeChat}
346-
reconnect={reconnect}
347-
isChatPage={isChatPage}
348-
showChatHistory={showChatHistory}
349-
assistantIDs={assistantIDs}
350-
/>
351-
352-
{isCurrentLogin ? (
353-
<ChatContent
336+
<div
337+
data-tauri-drag-region
338+
className={`flex flex-col rounded-md h-full overflow-hidden`}
339+
>
340+
<ChatHeader
341+
clearChat={clearChat}
342+
onOpenChatAI={openChatAI}
343+
setIsSidebarOpen={toggleSidebar}
344+
isSidebarOpen={isSidebarOpenChat}
354345
activeChat={activeChat}
355-
curChatEnd={curChatEnd}
356-
query_intent={query_intent}
357-
tools={tools}
358-
fetch_source={fetch_source}
359-
pick_source={pick_source}
360-
deep_read={deep_read}
361-
think={think}
362-
response={response}
363-
loadingStep={loadingStep}
364-
timedoutShow={timedoutShow}
365-
Question={Question}
346+
reconnect={reconnect}
347+
isChatPage={isChatPage}
348+
showChatHistory={showChatHistory}
366349
assistantIDs={assistantIDs}
367-
handleSendMessage={(value) =>
368-
handleSendMessage(value, activeChat)
369-
}
370-
getFileUrl={getFileUrl}
371350
/>
372-
) : (
373-
<ConnectPrompt />
374-
)}
375-
376-
{!activeChat?._id && !visibleStartPage && (
377-
<PrevSuggestion sendMessage={init} />
378-
)}
379351

380-
{/* <ReadAloud /> */}
381-
</div>
352+
{isCurrentLogin ? (
353+
<ChatContent
354+
activeChat={activeChat}
355+
curChatEnd={curChatEnd}
356+
query_intent={query_intent}
357+
tools={tools}
358+
fetch_source={fetch_source}
359+
pick_source={pick_source}
360+
deep_read={deep_read}
361+
think={think}
362+
response={response}
363+
loadingStep={loadingStep}
364+
timedoutShow={timedoutShow}
365+
Question={Question}
366+
assistantIDs={assistantIDs}
367+
handleSendMessage={(value) =>
368+
handleSendMessage(value, activeChat)
369+
}
370+
getFileUrl={getFileUrl}
371+
/>
372+
) : (
373+
<ConnectPrompt />
374+
)}
375+
376+
{!activeChat?._id && !visibleStartPage && (
377+
<PrevSuggestion sendMessage={init} />
378+
)}
379+
380+
{/* <ReadAloud /> */}
381+
</div>
382+
</>
382383
);
383384
}
384385
)

src/components/Assistant/ChatSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const ChatSidebar: React.FC<ChatSidebarProps> = ({
2929
<div
3030
data-sidebar
3131
className={`
32-
h-screen fixed top-0 left-0 z-100 w-64
32+
h-screen absolute top-0 left-0 z-100 w-64
3333
transform transition-all duration-300 ease-in-out
3434
${isSidebarOpen ? "translate-x-0" : "-translate-x-full"}
3535
bg-gray-100 dark:bg-gray-800

src/components/SearchChat/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ function SearchChat({
401401
<div
402402
data-tauri-drag-region={isTauri}
403403
className={clsx(
404-
"m-auto overflow-hidden relative bg-no-repeat bg-cover bg-center bg-white dark:bg-black flex flex-col transform",
404+
"m-auto overflow-hidden relative bg-no-repeat bg-cover bg-center bg-white dark:bg-black flex flex-col",
405405
[
406406
isTransitioned
407407
? "bg-chat_bg_light dark:bg-chat_bg_dark"

0 commit comments

Comments
 (0)