Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -453,4 +453,4 @@ export function ChatAttachment({
)}
</div>
);
}
}
9 changes: 7 additions & 2 deletions frontend/app/[locale]/chat/components/chatLeftSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import { useState, useMemo } from "react";
import {
Clock,
Plus,
Expand Down Expand Up @@ -102,13 +102,18 @@ export function ChatSidebar({
}: ChatSidebarProps) {
const { t } = useTranslation();
const { confirm } = useConfirmModal();
const { today, week, older } = categorizeConversations(conversationManagement.conversationList);
const [editingId, setEditingId] = useState<number | null>(null);
const [renameValue, setRenameValue] = useState("");
const [renameError, setRenameError] = useState<string | null>(null);
const [collapsed, setCollapsed] = useState(false);
const [openDropdownId, setOpenDropdownId] = useState<number | null>(null);

// Memoize conversation categorization to avoid redundant work on unrelated state changes
const { today, week, older } = useMemo(
() => categorizeConversations(conversationManagement.conversationList),
[conversationManagement.conversationList]
);

const onToggleSidebar = () => setCollapsed((prev) => !prev);

const handleRenameClick = (conversationId: number, currentTitle: string) => {
Expand Down
Loading
Loading