Skip to content
Open
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
21 changes: 15 additions & 6 deletions frontend/src/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,20 @@ export default function Sidebar({ sessions, currentSession, onNewChat, onLoadSes
{sessions.length === 0 ? "No chats yet. Start one!" : "No results."}
</p>
)}
{filtered.map(s => (
<div key={s.id} className={`group flex items-center gap-1 rounded-lg mb-0.5 transition
${currentSession === s.id ? "bg-gray-700" : "hover:bg-gray-800"}`}>
{filtered.map(s => {
const isActive = currentSession === s.id;
return (
<div key={s.id} className={`relative group flex items-center rounded-lg mb-0.5 transition
${isActive ? "bg-gray-700" : "hover:bg-gray-800"}`}>
{/* Activity indicator: always rendered, transparent when inactive */}
<span
aria-hidden="true"
className={`absolute left-2.5 top-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full bg-purple-400 transition-opacity duration-300
${isActive ? "opacity-100 animate-pulse" : "opacity-0"}`}
/>
<button onClick={()=>onLoadSession(s.id)}
className="flex-1 text-left text-xs px-3 py-2 truncate text-gray-400 group-hover:text-gray-200">
<span className={currentSession === s.id ? "text-white" : ""}>
className="flex-1 text-left text-xs pl-6 pr-3 py-2 truncate text-gray-400 group-hover:text-gray-200">
<span className={isActive ? "text-white" : ""}>
<span className="inline-flex items-center gap-1.5">
<ChatIcon className="w-3.5 h-3.5 text-gray-500" />
<span>{s.title || "New Chat"}</span>
Expand All @@ -77,7 +85,8 @@ export default function Sidebar({ sessions, currentSession, onNewChat, onLoadSes
×
</button>
</div>
))}
);
})}
</div>

{/* Footer */}
Expand Down