Skip to content

Commit 80fcb7f

Browse files
t3dotggclaude
andauthored
fix(web): boring sidebar folders put your latest message on top (#26391)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 40d335a commit 80fcb7f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ interface SidebarThreadPartitionInput {
337337
readonly serverConfigs: ReadonlyMap<EnvironmentId, EnvironmentServerConfig>;
338338
readonly optimisticDrop: SidebarOptimisticDrop | null;
339339
readonly workingShelfEnabled: boolean;
340+
/** Boring mode: folders list active threads by the user's latest message. */
341+
readonly sortActiveBySend: boolean;
340342
// Snooze wakes, the queued-turn grace and the Working shelf's exit grace depend
341343
// on the clock, so the minute tick, the precise snooze-wake tick and the inbox
342344
// tracker's expiry version are inputs: a new key repartitions.
@@ -458,6 +460,7 @@ function useSidebarThreads(input: {
458460
serverConfigs,
459461
optimisticDrop,
460462
workingShelfEnabled,
463+
sortActiveBySend: folderGroups !== null,
461464
clockKey: `${nowMinute}:${snoozeWakeClock}:${inboxReturnsVersion}`,
462465
});
463466

@@ -592,6 +595,7 @@ function partitionSidebarThreads(input: SidebarThreadPartitionInput) {
592595
serverConfigs,
593596
optimisticDrop,
594597
workingShelfEnabled,
598+
sortActiveBySend,
595599
} = input;
596600
const preciseNow = new Date().toISOString();
597601
const visible = filterSidebarV2VisibleThreads(threads, scopedProjectKeys, delegatedUnderParent);
@@ -650,9 +654,11 @@ function partitionSidebarThreads(input: SidebarThreadPartitionInput) {
650654
}
651655
// A loaded config gates dragging only; the sort must not depend on it, so web and mobile agree.
652656
const sortedPinned = sortPinnedThreadsForSidebar(pinned);
653-
const sortedActive = workingShelfEnabled
654-
? sortInboxThreadsByReturn(active, inboxObservation.returnedAt)
655-
: sortThreadsForSidebar(active);
657+
const sortedActive = sortActiveBySend
658+
? sortWorkingThreadsBySend(active)
659+
: workingShelfEnabled
660+
? sortInboxThreadsByReturn(active, inboxObservation.returnedAt)
661+
: sortThreadsForSidebar(active);
656662
return {
657663
pinnedThreads:
658664
optimisticDrop?.section !== "pinned" || optimisticDrop.order === null

0 commit comments

Comments
 (0)