From a3f1a2b036af0708731d1a4a94fec1cefbef2d15 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 27 Oct 2024 19:25:09 -0700 Subject: [PATCH] increase default history title length --- gui/src/hooks/useHistory.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gui/src/hooks/useHistory.tsx b/gui/src/hooks/useHistory.tsx index 5f5391ebc..ea9e0668b 100644 --- a/gui/src/hooks/useHistory.tsx +++ b/gui/src/hooks/useHistory.tsx @@ -11,6 +11,8 @@ import { RootState } from "../redux/store"; import { getLocalStorage, setLocalStorage } from "../util/localStorage"; import { useLastSessionContext } from "../context/LastSessionContext"; +const MAX_TITLE_LENGTH = 100; + function truncateText(text: string, maxLength: number) { if (text.length > maxLength) { return text.slice(0, maxLength - 3) + "..."; @@ -84,7 +86,7 @@ function useHistory(dispatch: Dispatch) { .split("\n") .filter((l) => l.trim() !== "") .slice(-1)[0] || "", - 50, + MAX_TITLE_LENGTH, ) : stateCopy.title?.length > 0 ? stateCopy.title