Skip to content
Open
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
2 changes: 1 addition & 1 deletion src-tauri/src/core/extensions/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ pub fn get_active_extensions<R: Runtime>(app: AppHandle<R>) -> Vec<serde_json::V
vec![]
}
};
return contents;
contents
}
}
2 changes: 1 addition & 1 deletion src-tauri/src/core/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ fn setup_window_theme_listener<R: Runtime>(
tauri::Theme::Dark => "dark",
_ => "auto",
};
log::info!("System theme changed to: {} for window: {}", theme_str, window_label);
log::info!("System theme changed to: {theme_str} for window: {window_label}");
let _ = app_handle_clone.emit("theme-changed", theme_str);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/core/threads/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ async fn test_concurrent_message_operations() {
let app_h = app_handle.clone();
let tid = thread_id.clone();
tokio::spawn(async move {
create_message(app_h, create_test_message(&tid, &format!("Message {}", i))).await
create_message(app_h, create_test_message(&tid, &format!("Message {i}"))).await
})
})
.collect();
Expand Down
200 changes: 102 additions & 98 deletions web-app/src/containers/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,13 @@ const LeftPanel = () => {
</div>

{filteredProjects.length > 0 && !(IS_IOS || IS_ANDROID) && (
<div className="space-y-1 py-1">
<div className="flex items-center justify-between mb-2">
<span className="block text-xs text-left-panel-fg/50 px-1 font-semibold">
<div className="space-y-1 py-1 rounded-lg mx-1 mb-3">
<div className="flex items-center justify-between mb-2 px-2 pt-2">
<span className="block text-xs text-left-panel-fg/50 font-semibold">
{t('common:projects.title')}
</span>
</div>
<div className="flex flex-col max-h-[140px] overflow-y-scroll">
<div className="flex flex-col max-h-[140px] overflow-y-scroll px-2 pb-2">
{filteredProjects
.slice()
.sort((a, b) => b.updated_at - a.updated_at)
Expand Down Expand Up @@ -495,125 +495,129 @@ const LeftPanel = () => {
<div className="flex flex-col h-full overflow-y-scroll w-[calc(100%+6px)]">
<div className="flex flex-col w-full h-full overflow-y-auto overflow-x-hidden mb-3">
<div className="h-full w-full overflow-y-auto">
{favoritedThreads.length > 0 && (
<>
<div className="flex items-center justify-between mb-2">
<span className="block text-xs text-left-panel-fg/50 px-1 font-semibold sticky top-0">
{t('common:favorites')}
{/* Chats Section with distinct background */}
<div className="rounded-lg mx-1 mb-3">
{favoritedThreads.length > 0 && (
<>
<div className="flex items-center justify-between mb-2 px-2 pt-2">
<span className="block text-xs text-left-panel-fg/50 font-semibold sticky top-0">
{t('common:favorites')}
</span>
<div className="relative">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button className="size-6 flex cursor-pointer items-center justify-center rounded hover:bg-left-panel-fg/10 transition-all duration-200 ease-in-out data-[state=open]:bg-left-panel-fg/10">
<IconDots
size={18}
className="text-left-panel-fg/60"
/>
</button>
</DropdownMenuTrigger>
<DropdownMenuContent side="bottom" align="end">
<DropdownMenuItem
onClick={() => {
unstarAllThreads()
toast.success(
t('common:toast.allThreadsUnfavorited.title'),
{
id: 'unfav-all-threads',
description: t(
'common:toast.allThreadsUnfavorited.description'
),
}
)
}}
>
<IconStar size={16} />
<span>{t('common:unstarAll')}</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
</div>
<div className="flex flex-col mb-4 px-2 pb-2">
<ThreadList
threads={favoritedThreads}
isFavoriteSection={true}
/>
{favoritedThreads.length === 0 && (
<p className="text-xs text-left-panel-fg/50 px-1 font-semibold">
{t('chat.status.empty', { ns: 'chat' })}
</p>
)}
</div>
</>
)}

{unFavoritedThreads.length > 0 && (
<div className="flex items-center justify-between mb-2 px-2 pt-2">
<span className="block text-xs text-left-panel-fg/50 font-semibold">
{t('common:recents')}
</span>
<div className="relative">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button className="size-6 flex cursor-pointer items-center justify-center rounded hover:bg-left-panel-fg/10 transition-all duration-200 ease-in-out data-[state=open]:bg-left-panel-fg/10">
<button
className="size-6 flex cursor-pointer items-center justify-center rounded hover:bg-left-panel-fg/10 transition-all duration-200 ease-in-out data-[state=open]:bg-left-panel-fg/10"
onClick={(e) => {
e.preventDefault()
e.stopPropagation()
}}
>
<IconDots
size={18}
className="text-left-panel-fg/60"
/>
</button>
</DropdownMenuTrigger>
<DropdownMenuContent side="bottom" align="end">
<DropdownMenuItem
onClick={() => {
unstarAllThreads()
toast.success(
t('common:toast.allThreadsUnfavorited.title'),
{
id: 'unfav-all-threads',
description: t(
'common:toast.allThreadsUnfavorited.description'
),
}
)
}}
>
<IconStar size={16} />
<span>{t('common:unstarAll')}</span>
</DropdownMenuItem>
<DeleteAllThreadsDialog
onDeleteAll={deleteAllThreads}
/>
</DropdownMenuContent>
</DropdownMenu>
</div>
</div>
<div className="flex flex-col mb-4">
<ThreadList
threads={favoritedThreads}
isFavoriteSection={true}
/>
{favoritedThreads.length === 0 && (
<p className="text-xs text-left-panel-fg/50 px-1 font-semibold">
{t('chat.status.empty', { ns: 'chat' })}
</p>
)}
</div>
</>
)}

{unFavoritedThreads.length > 0 && (
<div className="flex items-center justify-between mb-2">
<span className="block text-xs text-left-panel-fg/50 px-1 font-semibold">
{t('common:recents')}
</span>
<div className="relative">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button
className="size-6 flex cursor-pointer items-center justify-center rounded hover:bg-left-panel-fg/10 transition-all duration-200 ease-in-out data-[state=open]:bg-left-panel-fg/10"
onClick={(e) => {
e.preventDefault()
e.stopPropagation()
}}
>
<IconDots
size={18}
className="text-left-panel-fg/60"
/>
</button>
</DropdownMenuTrigger>
<DropdownMenuContent side="bottom" align="end">
<DeleteAllThreadsDialog
onDeleteAll={deleteAllThreads}
/>
</DropdownMenuContent>
</DropdownMenu>
</div>
</div>
)}
)}

{filteredThreads.length === 0 && searchTerm.length > 0 && (
<div className="px-1 mt-2">
<span className="block text-xs text-left-panel-fg/50 px-1 font-semibold mb-2">
{t('common:recents')}
</span>

<div className="flex items-center gap-1 text-left-panel-fg/80">
<IconSearch size={18} />
<h6 className="font-medium text-base">
{t('common:noResultsFound')}
</h6>
</div>
<p className="text-left-panel-fg/60 mt-1 text-xs leading-relaxed">
{t('common:noResultsFoundDesc')}
</p>
</div>
)}
{filteredThreads.length === 0 && searchTerm.length > 0 && (
<div className="px-3 mt-2 pb-2">
<span className="block text-xs text-left-panel-fg/50 px-1 font-semibold mb-2">
{t('common:recents')}
</span>

{Object.keys(threads).length === 0 && !searchTerm && (
<>
<div className="px-1 mt-2">
<div className="flex items-center gap-1 text-left-panel-fg/80">
<IconMessage size={18} />
<IconSearch size={18} />
<h6 className="font-medium text-base">
{t('common:noThreadsYet')}
{t('common:noResultsFound')}
</h6>
</div>
<p className="text-left-panel-fg/60 mt-1 text-xs leading-relaxed">
{t('common:noThreadsYetDesc')}
{t('common:noResultsFoundDesc')}
</p>
</div>
</>
)}
)}

{/* Show "No threads yet" when there are no threads at all OR when all threads are in projects */}
{(Object.keys(threads).length === 0 || (Object.keys(threads).length > 0 && unFavoritedThreads.length === 0 && favoritedThreads.length === 0)) && !searchTerm && (
<>
<div className="px-3 mt-2 pb-2">
<div className="flex items-center gap-1 text-left-panel-fg/80">
<IconMessage size={18} />
<h6 className="font-medium text-base">
{t('common:noThreadsYet')}
</h6>
</div>
<p className="text-left-panel-fg/60 mt-1 text-xs leading-relaxed">
{t('common:noThreadsYetDesc')}
</p>
</div>
</>
)}

<div className="flex flex-col">
<ThreadList threads={unFavoritedThreads} />
<div className="flex flex-col px-2 pb-2">
<ThreadList threads={unFavoritedThreads} />
</div>
</div>
</div>
</div>
Expand Down
Loading