fix(web): sidebar v2 polish — jump hints, working duration, in-flight fade, settled sort #4274
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit into
main fromrefs/pull/4274/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/web/src/components/Sidebar.logic.ts line 588Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -484,0 +496,21 @@496+>(threads: readonly T[]): T[] {497+ return [...threads].toSorted(498+ (left, right) =>499+ firstValidTimestampMs(right.settledAt, right.latestUserMessageAt, right.updatedAt) -500+ firstValidTimestampMs(left.settledAt, left.latestUserMessageAt, left.updatedAt) ||501+ left.id.localeCompare(right.id),502+ );503+}504+505+/** The timestamp a working thread's elapsed label counts from: the running506+ turn's start (request time until adoption), falling back to the session's507+ last transition when the turn projection lags behind. */508+export function resolveWorkingStartedAt(509+ thread: Pick<SidebarThreadSummary, "latestTurn" | "session">,510+): string | null {511+ const turn = thread.latestTurn;512+ if (turn && turn.completedAt === null) {513+ return turn.startedAt ?? turn.requestedAt;514+ }515+ return thread.session?.updatedAt ?? null;516+}
- apps/web/src/components/SidebarV2.tsx line 127OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -119,3 +120,8 @@119120 return compactSidebarTimeLabel(formatRelativeTimeLabel(timestamp));120121 }121122123+// Settled rows read "how long ago did this wrap up", matching their sort124+// key; auto-settled threads have no stamp and fall back to last activity.125+function settledTimeLabel(thread: SidebarThreadSummary): string {126+ const timestamp = thread.settledAt ?? thread.latestUserMessageAt ?? thread.updatedAt;127+ return compactSidebarTimeLabel(formatRelativeTimeLabel(timestamp));apps/web/src/components/SidebarV2.tsx line 138OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -119,3 +120,19 @@119120 return compactSidebarTimeLabel(formatRelativeTimeLabel(timestamp));120121 }121122123+// Settled rows read "how long ago did this wrap up", matching their sort124+// key; auto-settled threads have no stamp and fall back to last activity.125+function settledTimeLabel(thread: SidebarThreadSummary): string {126+ const timestamp = thread.settledAt ?? thread.latestUserMessageAt ?? thread.updatedAt;127+ return compactSidebarTimeLabel(formatRelativeTimeLabel(timestamp));128+}129+130+// Floats at the row's right edge, vertically centered, while the jump131+// modifier is held. An overlay pill instead of an inline slot: the hint132+// must neither displace the status/time label (holding ⌘ used to blank133+// out "Working") nor shift any layout when it appears.134+function JumpHintBadge(props: { label: string }) {135+ return (136+ <span137+ aria-hidden138+ className="absolute right-1.5 top-1/2 z-10 inline-flex h-5 -translate-y-1/2 items-center rounded-full border border-border/80 bg-background/95 px-1.5 font-mono text-[10px] font-medium tracking-tight text-foreground shadow-sm"
- apps/web/src/components/Sidebar.logic.ts line 562Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -482,3 +494,4 @@482494 );483495 }484496497+// Settled rows are history, so they order by when the work ENDED, not when
- apps/web/src/components/SidebarV2.tsx line 739Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -645,3 +698,6 @@645698 <CircleCheckIcon aria-hidden className="size-4 shrink-0" />646699 ) : null}647700 {topStatus.label}701+ {status === "working" ? (702+ <WorkingDuration startedAt={resolveWorkingStartedAt(thread)} />703+ ) : null}
t3dotgg(GitHub profile, opens in a new tab) changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- packages/contracts/src/settings.ts line 51OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -48,4 +48,4 @@4848 );4949 export type SidebarAutoSettleAfterDays = typeof SidebarAutoSettleAfterDays.Type;5050 export const DEFAULT_SIDEBAR_AUTO_SETTLE_AFTER_DAYS: SidebarAutoSettleAfterDays = 3;51-export const MIN_GLASS_OPACITY = 40;51+export const MIN_GLASS_OPACITY = 50;
t3dotgg(GitHub profile, opens in a new tab) changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XL
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged thisddd5a46
juliusmarminge closed this
Sign in to join this conversation.


🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.