diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-09-06 21:39:45 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-09-06 21:39:45 -0700 |
commit | 6e8885fc2f7feb06ef6ac87d2d7688f9f33d15de (patch) | |
tree | f69c615117c9b07329f1c9fd4b34435bc8b05fcd /extension/react-app/src/pages/history.tsx | |
parent | e9d289173ec28a1a90ae58b1834c476bb46834b8 (diff) | |
download | sncontinue-6e8885fc2f7feb06ef6ac87d2d7688f9f33d15de.tar.gz sncontinue-6e8885fc2f7feb06ef6ac87d2d7688f9f33d15de.tar.bz2 sncontinue-6e8885fc2f7feb06ef6ac87d2d7688f9f33d15de.zip |
fix: :lipstick: ui tweaks to history + scrollbars
Diffstat (limited to 'extension/react-app/src/pages/history.tsx')
-rw-r--r-- | extension/react-app/src/pages/history.tsx | 21 |
1 files changed, 16 insertions, 5 deletions
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<SessionInfo[]>([]); @@ -75,11 +80,15 @@ function History() { /> <h1 className="text-2xl font-bold m-4 inline-block">History</h1> </div> - <CheckDiv - checked={filteringByWorkspace} - onClick={() => setFilteringByWorkspace((prev) => !prev)} - title="Filter by workspace" - /> + {workspacePaths && workspacePaths.length > 0 && ( + <CheckDiv + checked={filteringByWorkspace} + onClick={() => setFilteringByWorkspace((prev) => !prev)} + title={`Show only sessions from ${lastPartOfPath( + workspacePaths[workspacePaths.length - 1] + )}/`} + /> + )} <table className="w-full"> <tbody> {sessions @@ -117,6 +126,8 @@ function History() { hour: "numeric", minute: "numeric", })} + {" | "} + {lastPartOfPath(session.workspace_directory || "")} </div> </TdDiv> </td> |