From 7bdde40d5625fac4a608bd0a61afbc8c91a99b43 Mon Sep 17 00:00:00 2001 From: 17ColinMiPerry <17colinmiperry@gmail.com> Date: Tue, 6 May 2025 11:05:02 -0700 Subject: [PATCH 1/3] fixed DOM nesting warnings --- .../Sidebar/ActiveWorkspaces/index.jsx | 23 +++++++++++-------- .../SuggestedChatMessages/index.jsx | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx index 14258d1326e..cbbab8c962c 100644 --- a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx +++ b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx @@ -6,7 +6,7 @@ import ManageWorkspace, { useManageWorkspaceModal, } from "../../Modals/ManageWorkspace"; import paths from "@/utils/paths"; -import { useParams } from "react-router-dom"; +import { useParams, useNavigate } from "react-router-dom"; import { GearSix, UploadSimple, DotsSixVertical } from "@phosphor-icons/react"; import useUser from "@/hooks/useUser"; import ThreadContainer from "./ThreadContainer"; @@ -15,6 +15,7 @@ import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; import showToast from "@/utils/toast"; export default function ActiveWorkspaces() { + const navigate = useNavigate(); const { slug } = useParams(); const [loading, setLoading] = useState(true); const [workspaces, setWorkspaces] = useState([]); @@ -159,14 +160,16 @@ export default function ActiveWorkspaces() { // weight="bold" /> - { + e.preventDefault(); + e.stopPropagation(); + navigate( + isInWorkspaceSettings + ? paths.workspace.chat(workspace.slug) + : paths.workspace.settings.generalAppearance(workspace.slug) + ); + }} className="rounded-md flex items-center justify-center text-[#A7A8A9] hover:text-white ml-auto p-[2px] hover:bg-[#646768]" aria-label="General appearance settings" > @@ -180,7 +183,7 @@ export default function ActiveWorkspaces() { // weight="bold" className="h-[20px] w-[20px]" /> - + )} diff --git a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx index f8fcf422e29..df3d88259e8 100644 --- a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx @@ -98,9 +98,9 @@ export default function SuggestedChatMessages({ slug }) {

{t("general.message.description")}

-

+

-

+
); return ( From c7977072d483ef1bc8c556db7752a88b64c31483 Mon Sep 17 00:00:00 2001 From: 17ColinMiPerry <17colinmiperry@gmail.com> Date: Tue, 6 May 2025 11:10:02 -0700 Subject: [PATCH 2/3] ran yarn lint --- frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx index cbbab8c962c..0c88bd707d8 100644 --- a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx +++ b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx @@ -167,7 +167,9 @@ export default function ActiveWorkspaces() { navigate( isInWorkspaceSettings ? paths.workspace.chat(workspace.slug) - : paths.workspace.settings.generalAppearance(workspace.slug) + : paths.workspace.settings.generalAppearance( + workspace.slug + ) ); }} className="rounded-md flex items-center justify-center text-[#A7A8A9] hover:text-white ml-auto p-[2px] hover:bg-[#646768]" From d2e081df18096652dc58dcdf8fc41ec948279345 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Tue, 6 May 2025 11:35:18 -0700 Subject: [PATCH 3/3] linting fix more HTML nesting errors --- .../src/components/Sidebar/ActiveWorkspaces/index.jsx | 8 ++------ .../ChatSettings/ChatPromptSettings/index.jsx | 11 ++++------- .../VectorDatabase/VectorCount/index.jsx | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx index 0c88bd707d8..c55c2b12472 100644 --- a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx +++ b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx @@ -10,7 +10,7 @@ import { useParams, useNavigate } from "react-router-dom"; import { GearSix, UploadSimple, DotsSixVertical } from "@phosphor-icons/react"; import useUser from "@/hooks/useUser"; import ThreadContainer from "./ThreadContainer"; -import { Link, useMatch } from "react-router-dom"; +import { useMatch } from "react-router-dom"; import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; import showToast from "@/utils/toast"; @@ -155,10 +155,7 @@ export default function ActiveWorkspaces() { }} className="border-none rounded-md flex items-center justify-center ml-auto p-[2px] hover:bg-[#646768] text-[#A7A8A9] hover:text-white" > - + diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx index cfc0f451b0c..e6b54fe5323 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState, useRef } from "react"; +import { useEffect, useState, useRef, Fragment } from "react"; import { chatPrompt } from "@/utils/chat"; import { useTranslation } from "react-i18next"; import SystemPromptVariable from "@/models/systemPromptVariable"; @@ -52,15 +52,12 @@ export default function ChatPromptSettings({ workspace, setHasChanges }) { {" "} like:{" "} {availableVariables.slice(0, 3).map((v, i) => ( - <> - + + {`{${v.key}}`} {i < availableVariables.length - 1 && ", "} - + ))} {availableVariables.length > 3 && ( {t("general.vector.description")}

-

+

-

+
); return (