From 8b11288764ac9ce407283717daa819cbab3caa57 Mon Sep 17 00:00:00 2001 From: Sean Hatfield Date: Tue, 16 Jan 2024 13:43:32 -0800 Subject: [PATCH] =?UTF-8?q?truncate=20title=20to=20shorter=20length=20so?= =?UTF-8?q?=20x=20button=20is=20not=20hidden=20for=20longer=E2=80=A6=20(#6?= =?UTF-8?q?03)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * truncate title to shorter length so x button is not hidden for longer title names in the citation modal * absolutely position x button on citation modal --- .../ChatHistory/Citation/index.jsx | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx index 1146639a..c4bda294 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx @@ -119,21 +119,19 @@ function CitationDetailModal({ source, onClose }) { className="bg-transparent outline-none fixed top-0 left-0 w-full h-full flex items-center justify-center z-10" >
-
-
-

- {truncate(title, 52)} -

- {references > 1 && ( -

- Referenced {references} times. -

- )} -
+
+

+ {truncate(title, 45)} +

+ {references > 1 && ( +

+ Referenced {references} times. +

+ )} @@ -159,6 +157,7 @@ function CitationDetailModal({ source, onClose }) { ); } + function truncateMiddle(title) { if (title.length <= 18) return title;