From 6e8885fc2f7feb06ef6ac87d2d7688f9f33d15de Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 6 Sep 2023 21:39:45 -0700 Subject: fix: :lipstick: ui tweaks to history + scrollbars --- extension/react-app/src/pages/gui.tsx | 16 +++++++++++++--- extension/react-app/src/pages/history.tsx | 21 ++++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) (limited to 'extension/react-app/src/pages') diff --git a/extension/react-app/src/pages/gui.tsx b/extension/react-app/src/pages/gui.tsx index c82f4f2b..99e7cb7b 100644 --- a/extension/react-app/src/pages/gui.tsx +++ b/extension/react-app/src/pages/gui.tsx @@ -33,6 +33,17 @@ import { temporarilyPushToUserInputQueue, } from "../redux/slices/serverStateReducer"; +const TopGuiDiv = styled.div` + overflow-y: scroll; + + scrollbar-width: none; /* Firefox */ + + /* Hide scrollbar for Chrome, Safari and Opera */ + &::-webkit-scrollbar { + display: none; + } +`; + const UserInputQueueItem = styled.div` border-radius: ${defaultBorderRadius}; color: gray; @@ -346,8 +357,7 @@ function GUI(props: GUIProps) { }; }, []); return ( -
{ if (e.key === "Enter" && e.ctrlKey) { @@ -498,7 +508,7 @@ function GUI(props: GUIProps) { addingHighlightedCode={adding_highlighted_code} /> -
+ ); } diff --git a/extension/react-app/src/pages/history.tsx b/extension/react-app/src/pages/history.tsx index a7e7276d..85d5e6d7 100644 --- a/extension/react-app/src/pages/history.tsx +++ b/extension/react-app/src/pages/history.tsx @@ -34,6 +34,11 @@ const TdDiv = styled.div` border-bottom: 1px solid ${secondaryDark}; `; +function lastPartOfPath(path: string): string { + const sep = path.includes("/") ? "/" : "\\"; + return path.split(sep).pop() || path; +} + function History() { const navigate = useNavigate(); const [sessions, setSessions] = useState([]); @@ -75,11 +80,15 @@ function History() { />

History

- setFilteringByWorkspace((prev) => !prev)} - title="Filter by workspace" - /> + {workspacePaths && workspacePaths.length > 0 && ( + setFilteringByWorkspace((prev) => !prev)} + title={`Show only sessions from ${lastPartOfPath( + workspacePaths[workspacePaths.length - 1] + )}/`} + /> + )} {sessions @@ -117,6 +126,8 @@ function History() { hour: "numeric", minute: "numeric", })} + {" | "} + {lastPartOfPath(session.workspace_directory || "")} -- cgit v1.2.3-70-g09d2