@devries-cameron20 / t3code Mirror · read-only / commits / 61b51ae0e3
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 17:45 UTC

feat(web): click the pin icon to unpin a thread (#5578)

Utkarsh Patil committed Aug 7, 2026 at 16:24 UTC 61b51ae0e343afc42ba0424d4d74b4f9a216d620
1 file changed +38 -7
apps/web/src/components/SidebarV2.tsx
+38 -7
@@ -403,8 +403,12 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
403 snoozeSupported: boolean;
404 // Renders the pin glyph. Pinned cards keep the full settle/snooze quick
405 // actions: settling clears the pin server-side, and snoozing hides the
406 - // card until wake with the pin intact underneath. Pin/unpin themselves
407 - // live in the context menu only.
406 + // card until wake with the pin intact underneath. The glyph is also the
407 + // in-row pin state cue (the pinned block has no header), so it always
408 + // shows while pinned; it only becomes a clickable unpin quick-action once
409 + // the pinning capability is confirmed, and stays a passive marker while
410 + // the descriptor is not loaded. Pinning itself lives in the context menu.
411 + pinningSupported: boolean;
412 isPinned: boolean;
413 // Compact wake countdown ("2h") for rows in the snoozed shelf.
414 snoozeWakeLabelText: string | null;
@@ -432,6 +436,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
436 onUnsettle: (threadRef: ScopedThreadRef) => void;
437 onSnooze: (threadRef: ScopedThreadRef, preset: SnoozePreset) => void;
438 onUnsnooze: (threadRef: ScopedThreadRef) => void;
439 + onUnpin: (threadRef: ScopedThreadRef) => void;
440 onAcknowledgeWoke: (threadRef: ScopedThreadRef, visitedAt: string) => void;
441 onChangeRequestState: (threadKey: string, state: "open" | "closed" | "merged" | null) => void;
442 }) {
@@ -450,6 +455,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
455 onThreadClick,
456 onUnsettle,
457 onUnsnooze,
458 + onUnpin,
459 renamingTitle,
460 thread,
461 variant,
@@ -704,6 +710,14 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
710 },
711 [onUnsnooze, threadRef],
712 );
713 + const handleUnpinClick = useCallback(
714 + (event: ReactMouseEvent) => {
715 + event.preventDefault();
716 + event.stopPropagation();
717 + onUnpin(threadRef);
718 + },
719 + [onUnpin, threadRef],
720 + );
721 const handleSnoozePreset = useCallback(
722 (preset: SnoozePreset) => {
723 onSnooze(threadRef, preset);
@@ -1001,11 +1015,23 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
1015 <span className="flex-1" />
1016 )}
1017 {props.isPinned ? (
1004 - <PinIcon
1005 - aria-label="Pinned"
1006 - role="img"
1007 - className="size-3 shrink-0 text-muted-foreground/65"
1008 - />
1018 + props.pinningSupported ? (
1019 + <button
1020 + type="button"
1021 + aria-label="Unpin thread"
1022 + title="Unpin thread"
1023 + onClick={handleUnpinClick}
1024 + className="inline-flex cursor-pointer items-center rounded-sm text-muted-foreground/65 outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
1025 + >
1026 + <PinIcon aria-hidden className="size-3 shrink-0" />
1027 + </button>
1028 + ) : (
1029 + <PinIcon
1030 + aria-label="Pinned"
1031 + role="img"
1032 + className="size-3 shrink-0 text-muted-foreground/65"
1033 + />
1034 + )
1035 ) : null}
1036 {/* The visible state owns this slot's width: status at rest,
1037 actions on hover/keyboard focus or while the popover is open. Keeping
@@ -3080,6 +3106,10 @@ export default function SidebarV2() {
3106 serverConfigs.get(thread.environmentId)?.environment.capabilities
3107 .threadSnooze === true
3108 }
3109 + pinningSupported={
3110 + serverConfigs.get(thread.environmentId)?.environment.capabilities
3111 + .threadPinning === true
3112 + }
3113 isPinned={section === "pinned"}
3114 snoozeWakeLabelText={
3115 section === "snoozed" && thread.snoozedUntil != null
@@ -3120,6 +3150,7 @@ export default function SidebarV2() {
3150 onUnsettle={attemptUnsettle}
3151 onSnooze={attemptSnooze}
3152 onUnsnooze={attemptUnsnooze}
3153 + onUnpin={attemptUnpin}
3154 onAcknowledgeWoke={acknowledgeWoke}
3155 onChangeRequestState={handleChangeRequestState}
3156 />