diff --git a/src/components/Common/Playground/History.tsx b/src/components/Common/Playground/History.tsx index d1ace83..ed19284 100644 --- a/src/components/Common/Playground/History.tsx +++ b/src/components/Common/Playground/History.tsx @@ -31,12 +31,8 @@ export const PlaygroundHistory = () => { return ( :nth-child(2)]:flex-1 [&>:nth-child(2)]:overflow-y-auto w-[300px] h-full pt-16 pb-5 transition-all duration-300 ease-in-out transform ${ - show - ? 'opacity-100 translate-x-0' - : 'opacity-0 -translate-x-full absolute' - }`} - style={{ paddingTop: "4rem" }} + className={`flex flex-col [&>:nth-child(2)]:flex-1 [&>:nth-child(2)]:overflow-y-auto w-[300px] h-full pt-16 pb-5 transition-all duration-300 ease-in-out`} + style={{ paddingTop: "4rem", width: show ? "300px" : "0" }} title={
{t("sidebarTitle")} diff --git a/src/components/Option/Playground/Playground.tsx b/src/components/Option/Playground/Playground.tsx index 2cd6d1b..e011365 100644 --- a/src/components/Option/Playground/Playground.tsx +++ b/src/components/Option/Playground/Playground.tsx @@ -1,4 +1,4 @@ -import React from "react" +import React, { useContext } from "react" import { Card } from "antd" @@ -23,6 +23,7 @@ import { PlaygroundTeam } from "@/components/Common/Playground/Team.tsx" import { PlaygroundTokenStatistics } from "@/components/Common/Playground/TokenStatistics.tsx" import { PlaygroundHistory } from "@/components/Common/Playground/History.tsx" import { PlaygroundIodRelevant } from "@/components/Common/Playground/IodRelevant.tsx" +import { HistoryContext } from "@/components/Layouts/Layout.tsx" export const Playground = () => { @@ -140,13 +141,15 @@ export const Playground = () => { setRecentMessagesOnLoad() }, []) + const { show } = useContext(HistoryContext) + return (
- +
{
- {messages.length && ( -
+ {messages.length && ( +
diff --git a/src/components/Option/Sidebar.tsx b/src/components/Option/Sidebar.tsx index cc44b82..1f85f4a 100644 --- a/src/components/Option/Sidebar.tsx +++ b/src/components/Option/Sidebar.tsx @@ -24,6 +24,7 @@ import { getLastUsedChatSystemPrompt, lastUsedChatModelEnabled } from "@/services/model-settings" +import { useState } from "react" type Props = { onClose: () => void @@ -169,7 +170,12 @@ export const Sidebar = ({ {group.items.map((chat, index) => (
+ className={` + flex py-2 px-2 items-center gap-3 relative rounded-md truncate hover:pr-4 group transition-opacity duration-300 ease-in-out border + hover:text-[#615ced] hover:bg-[#f3f2ff] dark:hover:bg-[#2d2d2d] dark:border-gray-800 + hover:[&_.more-vertical]:text-[#615ced] + ${historyId === chat.id ? 'text-[#615ced] bg-[#f3f2ff] border-[#615ced]' : 'dark:text-gray-100 text-gray-800'} + `}> {chat?.message_source === "copilot" && ( @@ -265,7 +271,7 @@ export const Sidebar = ({ trigger={["click"]} placement="bottomRight">