refactor: streamline sidebar layout and adjust note/chat limits

- Updated `AppSidebar` to simplify the layout by removing unnecessary div wrappers around `NavChats` and `NavNotes`.
- Adjusted the number of notes and chats displayed in the sidebar from 5 to 4 for a more compact design.
- Modified `SidebarContent` and `SidebarGroup` styles for improved spacing and layout consistency.
This commit is contained in:
Anish Sarkar 2025-12-19 19:36:10 +05:30
parent 79e552520a
commit 60d57305a7
3 changed files with 18 additions and 22 deletions

View file

@ -57,7 +57,7 @@ export function AppSidebarProvider({
useAtom(deleteChatMutationAtom);
useEffect(() => {
setChatsQueryParams((prev) => ({ ...prev, search_space_id: searchSpaceId, skip: 0, limit: 5 }));
setChatsQueryParams((prev) => ({ ...prev, search_space_id: searchSpaceId, skip: 0, limit: 4 }));
}, [searchSpaceId]);
const {
@ -84,7 +84,7 @@ export function AppSidebarProvider({
queryFn: () =>
notesApiService.getNotes({
search_space_id: Number(searchSpaceId),
page_size: 5, // Get 5 notes (changed from 10)
page_size: 4, // Get 4 notes for compact sidebar
}),
enabled: !!searchSpaceId,
});
@ -196,8 +196,8 @@ export function AppSidebarProvider({
return dateB - dateA; // Descending order (most recent first)
});
// Limit to 5 notes
return sortedNotes.slice(0, 5).map((note) => ({
// Limit to 4 notes for compact sidebar
return sortedNotes.slice(0, 4).map((note) => ({
name: note.title,
url: `/dashboard/${note.search_space_id}/editor/${note.id}`,
icon: "FileText",