diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/ChatHistoryButton.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/ChatHistoryButton.tsx index 9343b7ada..8a0f54fbb 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/ChatHistoryButton.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/ChatHistoryButton.tsx @@ -1,13 +1,13 @@ import { useTranslation } from "react-i18next"; import { LuChevronRight, LuHistory } from "react-icons/lu"; -import { ChatHistory } from "@/lib/components/ChatHistory/ChatHistory"; import { Popover, PopoverContent, PopoverTrigger, } from "@/lib/components/ui/Popover"; +import { ChatsList } from "./components/ChatsList"; import { Button } from "../Button"; export const ChatHistoryButton = (): JSX.Element => { @@ -27,7 +27,7 @@ export const ChatHistoryButton = (): JSX.Element => { align="center" className="min-h-[200px] w-[250px] max-h-[500px] overflow-auto" > - + ); diff --git a/frontend/app/chat/components/ChatsList/__tests__/ChatsList.test.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/__tests__/ChatsList.test.tsx similarity index 97% rename from frontend/app/chat/components/ChatsList/__tests__/ChatsList.test.tsx rename to frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/__tests__/ChatsList.test.tsx index 9c369efcd..c2078e57b 100644 --- a/frontend/app/chat/components/ChatsList/__tests__/ChatsList.test.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/__tests__/ChatsList.test.tsx @@ -102,9 +102,6 @@ describe("ChatsList", () => { ); const chatsList = getByTestId("chats-list"); expect(chatsList).toBeDefined(); - - const newChatButton = getByTestId("new-chat-button"); - expect(newChatButton).toBeDefined(); }); it("renders the chats list with correct number of items", () => { diff --git a/frontend/app/chat/components/ChatsList/components/WelcomeChat/WelcomeChat.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/components/WelcomeChat/WelcomeChat.tsx similarity index 100% rename from frontend/app/chat/components/ChatsList/components/WelcomeChat/WelcomeChat.tsx rename to frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/components/WelcomeChat/WelcomeChat.tsx diff --git a/frontend/app/chat/components/ChatsList/components/WelcomeChat/hooks/useWelcomeChat.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/components/WelcomeChat/hooks/useWelcomeChat.ts similarity index 100% rename from frontend/app/chat/components/ChatsList/components/WelcomeChat/hooks/useWelcomeChat.ts rename to frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/components/WelcomeChat/hooks/useWelcomeChat.ts diff --git a/frontend/app/chat/components/ChatsList/components/WelcomeChat/index.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/components/WelcomeChat/index.ts similarity index 100% rename from frontend/app/chat/components/ChatsList/components/WelcomeChat/index.ts rename to frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/components/WelcomeChat/index.ts diff --git a/frontend/app/chat/components/ChatsList/hooks/useChatNotificationsSync.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/hooks/useChatNotificationsSync.ts similarity index 86% rename from frontend/app/chat/components/ChatsList/hooks/useChatNotificationsSync.ts rename to frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/hooks/useChatNotificationsSync.ts index e4edc23a2..0a2ee12b7 100644 --- a/frontend/app/chat/components/ChatsList/hooks/useChatNotificationsSync.ts +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/hooks/useChatNotificationsSync.ts @@ -7,9 +7,9 @@ import { useNotificationApi } from "@/lib/api/notification/useNotificationApi"; import { useChatContext } from "@/lib/context"; import { useKnowledgeToFeedContext } from "@/lib/context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext"; -import { getChatNotificationsQueryKey } from "../../../[chatId]/utils/getChatNotificationsQueryKey"; -import { getMessagesFromChatItems } from "../../../[chatId]/utils/getMessagesFromChatItems"; -import { getNotificationsFromChatItems } from "../../../[chatId]/utils/getNotificationsFromChatItems"; +import { getChatNotificationsQueryKey } from "../../../../../../../../../../../utils/getChatNotificationsQueryKey"; +import { getMessagesFromChatItems } from "../../../../../../../../../../../utils/getMessagesFromChatItems"; +import { getNotificationsFromChatItems } from "../../../../../../../../../../../utils/getNotificationsFromChatItems"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const useChatNotificationsSync = () => { diff --git a/frontend/app/chat/components/ChatsList/hooks/useChatsList.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/hooks/useChatsList.ts similarity index 100% rename from frontend/app/chat/components/ChatsList/hooks/useChatsList.ts rename to frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/hooks/useChatsList.ts diff --git a/frontend/app/chat/components/ChatsList/index.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/index.tsx similarity index 53% rename from frontend/app/chat/components/ChatsList/index.tsx rename to frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/index.tsx index 8b7bfe5f5..2bf02509c 100644 --- a/frontend/app/chat/components/ChatsList/index.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/ChatHistoryButton/components/ChatsList/index.tsx @@ -1,10 +1,8 @@ "use client"; import { ChatHistory } from "@/lib/components/ChatHistory/ChatHistory"; -import { Sidebar } from "@/lib/components/Sidebar/Sidebar"; import { useOnboarding } from "@/lib/hooks/useOnboarding"; -import { NewChatButton } from "./components/NewChatButton"; import { WelcomeChat } from "./components/WelcomeChat"; import { useChatNotificationsSync } from "./hooks/useChatNotificationsSync"; import { useChatsList } from "./hooks/useChatsList"; @@ -15,18 +13,13 @@ export const ChatsList = (): JSX.Element => { const { shouldDisplayWelcomeChat } = useOnboarding(); return ( - -
+
+ {shouldDisplayWelcomeChat && (
- +
- {shouldDisplayWelcomeChat && ( -
- -
- )} - -
- + )} + +
); }; diff --git a/frontend/app/chat/components/ChatsList/components/NewChatButton.tsx b/frontend/app/chat/components/ChatsList/components/NewChatButton.tsx deleted file mode 100644 index 14db2fa95..000000000 --- a/frontend/app/chat/components/ChatsList/components/NewChatButton.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import Link from "next/link"; -import { useTranslation } from "react-i18next"; -import { BsPlusSquare } from "react-icons/bs"; - -const newChatRoute = "/chat"; -export const NewChatButton = (): JSX.Element => { - const { t } = useTranslation(); - - return ( - - {t("newChatButton")} - - ); -}; diff --git a/frontend/app/chat/components/index.ts b/frontend/app/chat/components/index.ts deleted file mode 100644 index 66c944f5c..000000000 --- a/frontend/app/chat/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ChatsList";