desktop: show target mode icon on sidebar sort toggle (#14189)

The sidebar time/project toggle showed the icon for the mode that was
already active. Swap it so the icon reflects the mode a click switches to:
folder icon while sorted by time, clock icon while grouped by project.

Co-authored-by: Saoud Rizwan <saoudrizwan@users.noreply.github.com>
This commit is contained in:
Saoud Rizwan
2026-09-16 09:56:03 -07:00
committed by GitHub
co-authored by Saoud Rizwan
parent 15f001ad0b
commit 99db7582b0
@@ -659,7 +659,7 @@ export function AgentSidebar({
);
// A single click flips straight to the other mode (a dropdown here would
// cost an extra click for a two-option choice); the icon shows the mode
// that is currently active.
// the click switches to, not the one currently active.
const sortToggle = (
<Button
aria-label={`Sort sessions: ${sortMode === "time" ? "Time" : "Project"}`}
@@ -676,9 +676,9 @@ export function AgentSidebar({
variant="ghost"
>
{sortMode === "time" ? (
<Clock3 className="size-3.5" />
) : (
<FolderTree className="size-3.5" />
) : (
<Clock3 className="size-3.5" />
)}
</Button>
);