From 0504b62d589499a3e559fa3edcc9441ef48f2204 Mon Sep 17 00:00:00 2001 From: anastasiia Date: Tue, 30 Jan 2024 12:46:25 -0500 Subject: [PATCH] minor UI fixes --- .../src/Project/CurrentTabContent/Header/TabButton.tsx | 10 ++++++++++ client/src/Project/CurrentTabContent/Header/index.tsx | 2 +- .../LeftSidebar/NavPanel/Studios/StudioSubItem.tsx | 4 ++-- client/src/Project/LeftSidebar/index.tsx | 8 ++++---- client/src/components/Header/index.tsx | 4 ++-- client/src/context/providers/TabsContextProvider.tsx | 4 ++-- client/src/locales/it.json | 3 ++- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/client/src/Project/CurrentTabContent/Header/TabButton.tsx b/client/src/Project/CurrentTabContent/Header/TabButton.tsx index bf3cc74f7d..8767faa616 100644 --- a/client/src/Project/CurrentTabContent/Header/TabButton.tsx +++ b/client/src/Project/CurrentTabContent/Header/TabButton.tsx @@ -47,6 +47,8 @@ type Props = TabType & { studioId?: string; initialRanges?: [number, number][]; isFileInContext?: boolean; + isDocInContext?: boolean; + initialSections?: string[]; conversationId?: string; initialQuery?: { path: string; @@ -77,7 +79,9 @@ const TabButton = ({ isTemp, studioId, initialRanges, + initialSections, isFileInContext, + isDocInContext, conversationId, initialQuery, relativeUrl, @@ -167,7 +171,9 @@ const TabButton = ({ tokenRange, studioId, initialRanges, + initialSections, isFileInContext, + isDocInContext, conversationId, initialQuery, favicon, @@ -205,7 +211,9 @@ const TabButton = ({ tokenRange, studioId, initialRanges, + initialSections, isFileInContext, + isDocInContext, conversationId, initialQuery, docId, @@ -224,7 +232,9 @@ const TabButton = ({ title, studioId, initialRanges, + initialSections, isFileInContext, + isDocInContext, conversationId, initialQuery, ]); diff --git a/client/src/Project/CurrentTabContent/Header/index.tsx b/client/src/Project/CurrentTabContent/Header/index.tsx index af9518236c..bf91599659 100644 --- a/client/src/Project/CurrentTabContent/Header/index.tsx +++ b/client/src/Project/CurrentTabContent/Header/index.tsx @@ -88,7 +88,7 @@ const ProjectHeader = ({ side }: Props) => { > {tabs.map(({ key, ...t }, i) => ( [r.start, r.end]), }); - } else if (docId && relativeUrl) { + } else if (docId) { openNewTab({ type: TabTypesEnum.DOC, studioId, title: docTitle, - relativeUrl, + relativeUrl: relativeUrl || '', docId, favicon: docFavicon, isDocInContext: true, diff --git a/client/src/Project/LeftSidebar/index.tsx b/client/src/Project/LeftSidebar/index.tsx index 2b923ff3e5..8ba12a30f4 100644 --- a/client/src/Project/LeftSidebar/index.tsx +++ b/client/src/Project/LeftSidebar/index.tsx @@ -79,16 +79,16 @@ const LeftSidebar = ({}: Props) => { className="h-full relative z-10 min-w-[204px] flex-shrink-0 overflow-hidden flex flex-col" ref={panelRef} > -
+
{os.type === 'Darwin' ? : ''} -
-

+

+

{project?.name || 'Default project'}

diff --git a/client/src/components/Header/index.tsx b/client/src/components/Header/index.tsx index c5a06c11fc..cba2bd7bc2 100644 --- a/client/src/components/Header/index.tsx +++ b/client/src/components/Header/index.tsx @@ -75,8 +75,8 @@ const Header = ({ type = 'default' }: Props) => { DropdownComponent={ProjectsDropdown} dropdownPlacement="bottom-start" > -
-

+

+

{project?.name || 'Default project'}

diff --git a/client/src/context/providers/TabsContextProvider.tsx b/client/src/context/providers/TabsContextProvider.tsx index a3c2bce291..e72f4a1a09 100644 --- a/client/src/context/providers/TabsContextProvider.tsx +++ b/client/src/context/providers/TabsContextProvider.tsx @@ -127,7 +127,7 @@ const TabsContextProvider = ({ children }: PropsWithChildren) => { : { ...data, type: TabTypesEnum.DOC, - key: data.docId + data.relativeUrl, + key: 'doc-' + data.docId + data.relativeUrl, }; if (newTab.type === TabTypesEnum.FILE) { updateArrayInStorage( @@ -139,7 +139,7 @@ const TabsContextProvider = ({ children }: PropsWithChildren) => { newTab.type === TabTypesEnum.CHAT && newTab.conversationId ? t.type === TabTypesEnum.CHAT && t.conversationId === newTab.conversationId - : t.key === newTab.key || + : (t.key === newTab.key && t.type === newTab.type) || (t.type === TabTypesEnum.FILE && t.isTemp), ); if (!previousTab) { diff --git a/client/src/locales/it.json b/client/src/locales/it.json index 32e871f308..0be100756a 100644 --- a/client/src/locales/it.json +++ b/client/src/locales/it.json @@ -507,5 +507,6 @@ "In this project": "In questo progetto", "Existing studio conversations": "Conversazioni in studio esistenti", "Select section": "Seleziona la sezione", - "Clear section": "Pulisci sezione" + "Clear section": "Pulisci sezione", + "Let’s get you started with bloop!": "Ti cominciamo con Bloop!" } \ No newline at end of file