Skip to content
Merged
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
12 changes: 9 additions & 3 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ interface SidebarThreadPartitionInput {
readonly serverConfigs: ReadonlyMap<EnvironmentId, EnvironmentServerConfig>;
readonly optimisticDrop: SidebarOptimisticDrop | null;
readonly workingShelfEnabled: boolean;
/** Boring mode: folders list active threads by the user's latest message. */
readonly sortActiveBySend: boolean;
// Snooze wakes, the queued-turn grace and the Working shelf's exit grace depend
// on the clock, so the minute tick, the precise snooze-wake tick and the inbox
// tracker's expiry version are inputs: a new key repartitions.
Expand Down Expand Up @@ -458,6 +460,7 @@ function useSidebarThreads(input: {
serverConfigs,
optimisticDrop,
workingShelfEnabled,
sortActiveBySend: folderGroups !== null,
clockKey: `${nowMinute}:${snoozeWakeClock}:${inboxReturnsVersion}`,
});

Expand Down Expand Up @@ -592,6 +595,7 @@ function partitionSidebarThreads(input: SidebarThreadPartitionInput) {
serverConfigs,
optimisticDrop,
workingShelfEnabled,
sortActiveBySend,
} = input;
const preciseNow = new Date().toISOString();
const visible = filterSidebarV2VisibleThreads(threads, scopedProjectKeys, delegatedUnderParent);
Expand Down Expand Up @@ -650,9 +654,11 @@ function partitionSidebarThreads(input: SidebarThreadPartitionInput) {
}
// A loaded config gates dragging only; the sort must not depend on it, so web and mobile agree.
const sortedPinned = sortPinnedThreadsForSidebar(pinned);
const sortedActive = workingShelfEnabled
? sortInboxThreadsByReturn(active, inboxObservation.returnedAt)
: sortThreadsForSidebar(active);
const sortedActive = sortActiveBySend
? sortWorkingThreadsBySend(active)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
: workingShelfEnabled
? sortInboxThreadsByReturn(active, inboxObservation.returnedAt)
: sortThreadsForSidebar(active);
return {
pinnedThreads:
optimisticDrop?.section !== "pinned" || optimisticDrop.order === null
Expand Down
Loading