Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ↕️ Maximise chat window #1301

Merged
merged 7 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const App = ({ children }: PropsWithChildren): JSX.Element => {
return (
<QueryClientProvider client={queryClient}>
<NavBar />
<div className="flex-1">{children}</div>
{children}
<Footer />
<UpdateMetadata />
</QueryClientProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ActionsBar = (): JSX.Element => {
</AnimatePresence>
)}
{!shouldDisplayFeedCard && (
<div className="flex mt-1 flex-col w-full shadow-md dark:shadow-primary/25 hover:shadow-xl transition-shadow rounded-xl bg-white dark:bg-black border border-black/10 dark:border-white/25 md:mb-4 lg:mb-[-20px] p-2">
<div className="flex mt-1 flex-col w-full shadow-md dark:shadow-primary/25 hover:shadow-xl transition-shadow rounded-xl bg-white dark:bg-black border border-black/10 dark:border-white/25 p-2">
<ChatInput shouldDisplayFeedCard={shouldDisplayFeedCard} />
</div>
)}
Expand Down
29 changes: 0 additions & 29 deletions frontend/app/chat/[chatId]/components/ChatHeader.tsx

This file was deleted.

16 changes: 6 additions & 10 deletions frontend/app/chat/[chatId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,28 @@ import { useCustomDropzone } from "@/lib/hooks/useDropzone";

import { ActionsBar } from "./components/ActionsBar";
import { ChatDialogueArea } from "./components/ChatDialogueArea/ChatDialogue";
import { ChatHeader } from "./components/ChatHeader";

const SelectedChatPage = (): JSX.Element => {
const { getRootProps } = useCustomDropzone();
const { shouldDisplayFeedCard } = useKnowledgeToFeedContext();

return (
<main
className="flex flex-col w-full h-[calc(100vh-61px)] overflow-hidden"
<div
className={`flex flex-col flex-1 items-center justify-stretch w-full h-[100vh] overflow-hidden ${
shouldDisplayFeedCard ? "bg-chat-bg-gray" : "bg-white"
} dark:bg-black transition-colors ease-out duration-500`}
data-testid="chat-page"
{...getRootProps()}
>
<section className="flex flex-col flex-1 items-center w-full h-full overflow-y-auto">
<ChatHeader />
<div
className={`flex-1 flex flex-col mt-4 md:mt-8 w-full shadow-md dark:shadow-primary/25 hover:shadow-xl transition-shadow rounded-xl overflow-hidden dark:bg-black border border-black/10 dark:border-white/25 p-2 md:p-12 pt-4 md:pt-10 ${
shouldDisplayFeedCard ? "bg-chat-bg-gray" : "bg-white"
}`}
className={`flex flex-col flex-1 w-full max-w-5xl h-full dark:shadow-primary/25 overflow-hidden p-2 sm:p-4 md:p-6 lg:p-8`}
>
<div className="flex flex-1 flex-col overflow-y-auto">
<ChatDialogueArea />
</div>
<ActionsBar />
</div>
</section>
</main>
</div>
);
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const RootLayout = async ({
<SupabaseProvider session={session}>
<BrainProvider>
<App>
<div className="flex-1">{children}</div>
{children}
</App>
</BrainProvider>
</SupabaseProvider>
Expand Down
26 changes: 13 additions & 13 deletions frontend/lib/components/NavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import { NavItems } from "./components/NavItems";

export const NavBar = (): JSX.Element => {
const path = usePathname();
const pageHasSidebar =
path === null ||
path.startsWith("/chat") ||
path.startsWith("/brains-management");

if (pageHasSidebar) {
return <></>;
}

return (
<>
{path === null ||
path.startsWith("/chat") ||
path.startsWith("/brains-management") ? (
<></>
) : (
<Header>
<Logo />
<NavItems className="hidden sm:flex" />
<MobileMenu />
</Header>
)}
</>
<Header>
<Logo />
<NavItems className="hidden sm:flex" />
<MobileMenu />
</Header>
);
};
7 changes: 2 additions & 5 deletions frontend/public/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@
"shortcut_manage_brains": "CMDB: Manage your brains",
"shortcut_go_to_user_page": "CMDU: Go to user page",
"shortcut_go_to_shortcuts": "CMDK: Go to shortcuts",
"chat_title_intro": "Chat with your",
"empty_brain_title_prefix": "Upload files in a",
"empty_brain_title_suffix": "and chat with them",
"actions_bar_placeholder": "Ask a question to a @brain and choose your #prompt",
"missing_brain": "Please select a brain to chat with",
"new_prompt": "Create new prompt",
"feed_brain_placeholder": "Choose which @brain you want to feed with these files",
"feedingBrain": "Your newly added knowledge is being processed, you can keep chatting in the meantime !",
"add_content_card_button_tooltip": "Add knowledge to a brain",
"onboarding":{
"onboarding": {
"step_1_message_1": "Hi 👋🏻 Want to discover Quivr ? 😇",
"step_1_message_2": "Step 1: Download “Quivr documentation”"
}
}
}
6 changes: 1 addition & 5 deletions frontend/public/locales/es/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"brain": "cerebro",
"brains": "cerebros",
"chat": "Conversar",
"chat_title_intro": "Conversación con",
"chatDeleted": "Chat borrado correstamente. Id: {{id}}",
"chatNameUpdated": "Nombre de chat actualizado",
"empty_brain_title_intro": "Chatea con tus",
"empty_brain_title_prefix": "Carga archivos en un",
"empty_brain_title_suffix": "y chatea con ellos",
"error_occurred": "Error al obtener respuesta",
"errorCallingAPI": "Error al llamar a la API",
"errorDeleting": "Error al borrar chat: {{error}}",
Expand All @@ -35,7 +31,7 @@
"title": "Conversa con {{brain}}",
"missing_brain": "No hay cerebro seleccionado",
"new_prompt": "Crear nueva instrucción",
"feed_brain_placeholder" : "Elige cuál @cerebro quieres alimentar con estos archivos",
"feed_brain_placeholder": "Elige cuál @cerebro quieres alimentar con estos archivos",
"feedingBrain": "Su conocimiento recién agregado se está procesando, ¡puede seguir chateando mientras tanto!",
"add_content_card_button_tooltip": "Agregar conocimiento a un cerebro",
"onboarding":{
Expand Down
6 changes: 1 addition & 5 deletions frontend/public/locales/fr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"brain": "cerveau",
"brains": "cerveaux",
"chat": "Chat",
"chat_title_intro": "Parle avec",
"chatDeleted": "Chat supprimé avec succès. Id : {{id}}",
"chatNameUpdated": "Nom du chat mis à jour",
"empty_brain_title_intro": "Discutez avec vos",
"empty_brain_title_prefix": "Téléchargez des fichiers dans un",
"empty_brain_title_suffix": "et discutez avec eux",
"error_occurred": "Une erreur s'est produite lors de l'obtention de la réponse",
"errorCallingAPI": "Erreur lors de l'appel à l'API",
"errorDeleting": "Erreur lors de la suppression du chat : {{error}}",
Expand All @@ -35,7 +31,7 @@
"title": "Discuter avec {{brain}}",
"missing_brain": "Veuillez selectionner un cerveau pour discuter",
"new_prompt": "Créer un nouveau prompt",
"feed_brain_placeholder" : "Choisissez le @cerveau que vous souhaitez nourrir avec ces fichiers",
"feed_brain_placeholder": "Choisissez le @cerveau que vous souhaitez nourrir avec ces fichiers",
"feedingBrain": "Vos nouvelles connaissances sont en cours de traitement. Vous pouvez continuer à discuter en attendant !",
"add_content_card_button_tooltip": "Ajouter des connaissances à un cerveau",
"onboarding":{
Expand Down
6 changes: 1 addition & 5 deletions frontend/public/locales/pt-br/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"brain": "cérebro",
"brains": "cérebros",
"chat": "Conversa",
"chat_title_intro": "Conversa com",
"chatDeleted": "Conversa excluída com sucesso. Id: {{id}}",
"chatNameUpdated": "Nome da conversa atualizado",
"empty_brain_title_intro": "Converse com o seu",
"empty_brain_title_prefix": "Carregue arquivos em um",
"empty_brain_title_suffix": "e converse com eles",
"error_occurred": "Ocorreu um erro ao obter a resposta",
"errorCallingAPI": "Erro ao chamar a API",
"errorDeleting": "Erro ao excluir a conversa: {{error}}",
Expand All @@ -35,7 +31,7 @@
"title": "Converse com {{brain}}",
"missing_brain": "Cérebro não encontrado",
"new_prompt": "Criar novo prompt",
"feed_brain_placeholder" : "Escolha qual @cérebro você deseja alimentar com esses arquivos",
"feed_brain_placeholder": "Escolha qual @cérebro você deseja alimentar com esses arquivos",
"feedingBrain": "Seu conhecimento recém-adicionado está sendo processado, você pode continuar conversando enquanto isso!",
"add_content_card_button_tooltip": "Adicionar conhecimento a um cérebro",
"onboarding":{
Expand Down
6 changes: 1 addition & 5 deletions frontend/public/locales/ru/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"brain": "мозг",
"brains": "мозги",
"chat": "Чат",
"chat_title_intro": "Чат с",
"chatDeleted": "Чат успешно удален. Id: {{id}}",
"chatNameUpdated": "Имя чата обновлено",
"empty_brain_title_intro": "Чат с вашими",
"empty_brain_title_prefix": "Загрузите файлы в",
"empty_brain_title_suffix": "и общайтесь с ними",
"error_occurred": "Произошла ошибка при получении ответа",
"errorCallingAPI": "Ошибка вызова API",
"errorDeleting": "Ошибка при удалении чата: {{error}}",
Expand All @@ -35,7 +31,7 @@
"title": "Чат с {{brain}}",
"missing_brain": "Мозг не найден",
"new_prompt": "Создать новый запрос",
"feed_brain_placeholder" : "Выберите, какой @мозг вы хотите питать этими файлами",
"feed_brain_placeholder": "Выберите, какой @мозг вы хотите питать этими файлами",
"feedingBrain": "Ваш недавно добавленный знаний обрабатывается, вы можете продолжить общение в это время!",
"add_content_card_button_tooltip": "Добавить знаний в мозг",
"onboarding":{
Expand Down
5 changes: 1 addition & 4 deletions frontend/public/locales/zh-cn/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@
"shortcut_manage_brains": "CMDB: 管理你的大脑",
"shortcut_go_to_user_page": "CMDU: 进入用户页面",
"shortcut_go_to_shortcuts": "CMDK: 前往快捷方式",
"chat_title_intro": "来聊天吧,通过你的",
"empty_brain_title_prefix": "上传文件到",
"empty_brain_title_suffix": "和他们聊天",
"actions_bar_placeholder": "向@大脑提问,选择您的#提示",
"missing_brain": "请选择一个大脑进行聊天",
"new_prompt": "新提示",
"feed_brain_placeholder" : "选择要用这些文件喂养的 @大脑",
"feed_brain_placeholder": "选择要用这些文件喂养的 @大脑",
"feedingBrain": "您新添加的知识正在处理中,同时您可以继续聊天!",
"add_content_card_button_tooltip": "向大脑添加知识",
"onboarding":{
Expand Down
Loading