diff --git a/gui/src/components/History/index.tsx b/gui/src/components/History/index.tsx index e1a12644e..5c90c671e 100644 --- a/gui/src/components/History/index.tsx +++ b/gui/src/components/History/index.tsx @@ -10,11 +10,7 @@ import { } from "react"; import Shortcut from "../gui/Shortcut"; -import { - ChevronLeftIcon, - ChevronRightIcon, - XMarkIcon, -} from "@heroicons/react/24/solid"; +import { XMarkIcon } from "@heroicons/react/24/solid"; import { useNavigate } from "react-router-dom"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; @@ -25,20 +21,12 @@ import { import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice"; import { refreshSessionMetadata } from "../../redux/thunks/session"; import { getFontSize, getPlatform } from "../../util"; -import { cn } from "../../util/cn"; import { ROUTES } from "../../util/navigation"; import ConfirmationDialog from "../dialogs/ConfirmationDialog"; import { Button } from "../ui"; import { HistoryTableRow } from "./HistoryTableRow"; import { groupSessionsByDate, parseDate } from "./util"; -const yesterday = new Date(Date.now() - 1000 * 60 * 60 * 24); -const lastWeek = new Date(Date.now() - 1000 * 60 * 60 * 24 * 7); -const lastMonth = new Date(Date.now() - 1000 * 60 * 60 * 24 * 30); -const earlier = new Date(0); - -const HEADER_CLASS = "user-select-none sticky mb-3 ml-2 flex h-6 justify-start text-left text-base font-bold opacity-75"; - export function History() { const dispatch = useAppDispatch(); const navigate = useNavigate(); @@ -46,7 +34,6 @@ export function History() { const ideMessenger = useContext(IdeMessengerContext); const [searchTerm, setSearchTerm] = useState(""); - const [collapsed, setCollapsed] = useState(false); const minisearch = useRef( new MiniSearch({ @@ -149,27 +136,11 @@ export function History() { return (
- {/* Collapse Button */} - - - {/* Search Input */} - {!collapsed && ( - <> -
- {filteredAndSortedSessions.length === 0 && ( -
- {isSessionMetadataLoading ? ( - "Loading Sessions..." - ) : ( - <> - No past sessions found. To start a new session, either click the - "+" button or use the keyboard shortcut:{" "} - meta L - - )} -
+
+ {filteredAndSortedSessions.length === 0 && ( +
+ {isSessionMetadataLoading ? ( + "Loading Sessions..." + ) : ( + <> + No past sessions found. To start a new session, either click the + "+" button or use the keyboard shortcut:{" "} + meta L + )} +
+ )} - - - {sessionGroups.map((group, groupIndex) => ( - - - - - {group.sessions.map((session, sessionIndex) => ( - - ))} - +
{group.label}
+ + {sessionGroups.map((group, groupIndex) => ( + + + + + {group.sessions.map((session, sessionIndex) => ( + ))} - -
{group.label}
-
+ + ))} + + +
-
- - - Chat history is saved to{" "} - - {platform === "windows" - ? "%USERPROFILE%/.continue" - : "~/.continue/sessions"} - - -
- - )} +
+ + + Chat history is saved to{" "} + + {platform === "windows" + ? "%USERPROFILE%/.continue" + : "~/.continue/sessions"} + + +
); }