feat(sidebar-v2): bring back thread pinning #5312
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 4 commits into
main fromrefs/pull/5312/headmerged by t3dotgg(GitHub profile, opens in a new tab) 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:XL
- apps/mobile/src/features/home/HomeScreen.tsx line 785Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -753,6 +777,9 @@753777 settlementSupported={settlementEnvironmentIds.has(thread.environmentId)}754778 onSettleThread={handleSettleThread}755779 snoozeSupported={snoozeEnvironmentIds.has(thread.environmentId)}780+ pinningSupported={pinningEnvironmentIds.has(thread.environmentId)}756781 onSnoozeThread={handleSnoozeThread}757782 onUnsnoozeThread={handleUnsnoozeThread}758783 onUnsettleThread={handleUnsettleThread}784+ onPinThread={handlePinThread}785+ onUnpinThread={handleUnpinThread}apps/web/src/components/SidebarV2.tsx line 2320Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -2317,4 +2416,3 @@23172416 },23182417 ]23192418 : []),2320- ...(supportsSettlement
- @@ -506,0 +509,21 @@509+ // stamp invisible state — the pin would hold the card in place until510+ // a separate unpin.511+ if (thread.pinnedAt == null) {512+ return settledEvent;513+ }514+ return [515+ settledEvent,516+ {517+ ...(yield* withEventBase({518+ aggregateKind: "thread",519+ aggregateId: command.threadId,520+ occurredAt,521+ commandId: command.commandId,522+ })),523+ type: "thread.unpinned" as const,524+ payload: {525+ threadId: command.threadId,526+ updatedAt: occurredAt,527+ },528+ },529+ ];
- @@ -82,3 +82,8 @@8282 { id: "delete", title: "Delete", image: "trash", attributes: { destructive: true } },8383 ];848485+// Pinned rows: Settle stays the lifecycle action (settling clears the pin86+// server-side); Unpin is the menu-only escape hatch. Snooze is withheld —87+// it does not unpin, so the pin would override it invisibly.88+const PINNED_MENU_ACTIONS: MenuAction[] = [89+ { id: "settle", title: "Settle", image: "checkmark" },
- @@ -805,4 +843,4 @@805843 ? SLIM_MENU_ACTIONS806844 : swipeActions.secondary === "snooze"807845 ? snoozableCardMenuActions808- : CARD_MENU_ACTIONS846+ : cardMenuActions@@ -632,0 +699,21 @@699+ updatedAt: occurredAt,700+ },701+ });702+ }703+ if (thread.snoozedUntil != null) {704+ promotionEvents.push({705+ ...(yield* withEventBase({706+ aggregateKind: "thread",707+ aggregateId: command.threadId,708+ occurredAt,709+ commandId: command.commandId,710+ })),711+ type: "thread.unsnoozed",712+ payload: {713+ threadId: command.threadId,714+ reason: "user",715+ updatedAt: occurredAt,716+ },717+ });718+ }719+ return promotionEvents.length > 0 ? [pinnedEvent, ...promotionEvents] : pinnedEvent;
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
c90c084a-a72f-4953-88ec-706df2cdc316You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share