Skip to content

Commit 8ee2f08

Browse files
fix(web): gate the unpin quick action on the threadPinning capability
1 parent 2535852 commit 8ee2f08

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,9 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
404404
// actions: settling clears the pin server-side, and snoozing hides the
405405
// card until wake with the pin intact underneath. The pin glyph itself
406406
// is a quick-action that unpins in place; pinning lives in the context
407-
// menu.
407+
// menu. Like the other lifecycle affordances it is capability-gated so
408+
// it hides rather than fails while the descriptor is not loaded.
409+
pinningSupported: boolean;
408410
isPinned: boolean;
409411
// Compact wake countdown ("2h") for rows in the snoozed shelf.
410412
snoozeWakeLabelText: string | null;
@@ -999,7 +1001,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
9991001
) : (
10001002
<span className="flex-1" />
10011003
)}
1002-
{props.isPinned ? (
1004+
{props.isPinned && props.pinningSupported ? (
10031005
<button
10041006
type="button"
10051007
aria-label="Unpin thread"
@@ -3122,6 +3124,10 @@ export default function SidebarV2() {
31223124
serverConfigs.get(thread.environmentId)?.environment.capabilities
31233125
.threadSnooze === true
31243126
}
3127+
pinningSupported={
3128+
serverConfigs.get(thread.environmentId)?.environment.capabilities
3129+
.threadPinning === true
3130+
}
31253131
isPinned={section === "pinned"}
31263132
snoozeWakeLabelText={
31273133
section === "snoozed" && thread.snoozedUntil != null

0 commit comments

Comments
 (0)