Skip to content

Commit 1d087d2

Browse files
fix(web): keep pinned thread markers stable on hover
1 parent 0121935 commit 1d087d2

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
21922192
onPointerDown={handleActionPointerDown}
21932193
className={cn(
21942194
"pointer-events-none absolute inset-y-0 right-0 -mr-1 inline-flex cursor-pointer items-center gap-1 rounded-md bg-transparent px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 group-any-hover/sidebar-row:pointer-events-auto group-any-hover/sidebar-row:opacity-100",
2195-
isWoke && "group-any-hover/sidebar-row:static",
2195+
isWoke && "static",
21962196
)}
21972197
>
21982198
<AlarmClockOffIcon className="mb-px size-3" />
@@ -2209,7 +2209,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
22092209
onPointerDown={handleActionPointerDown}
22102210
className={cn(
22112211
"pointer-events-none absolute inset-y-0 right-0 -mr-1 inline-flex cursor-pointer items-center gap-1 rounded-md bg-transparent px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 group-any-hover/sidebar-row:pointer-events-auto group-any-hover/sidebar-row:opacity-100",
2212-
isWoke && "group-any-hover/sidebar-row:static",
2212+
isWoke && "static",
22132213
)}
22142214
/>
22152215
}
@@ -2226,7 +2226,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
22262226
onPointerDown={handleActionPointerDown}
22272227
className={cn(
22282228
"pointer-events-none absolute inset-y-0 right-0 inline-flex cursor-pointer items-center gap-1 rounded-md bg-transparent px-2 text-xs text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 group-any-hover/sidebar-row:pointer-events-auto group-any-hover/sidebar-row:opacity-100",
2229-
isWoke && "group-any-hover/sidebar-row:static",
2229+
isWoke && "static",
22302230
)}
22312231
>
22322232
<CheckIcon className="size-3" />
@@ -2294,22 +2294,23 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
22942294
<span className="flex-1" />
22952295
)}
22962296
{pinIndicator}
2297+
{/* Reserve both states' widths so revealing actions cannot move the pin or Woke label. */}
22972298
{sortable?.isDragging ? (
22982299
dragDestination
22992300
) : (
23002301
<span
23012302
className={cn(
2302-
"group/sidebar-status-slot relative ml-auto flex h-5 min-w-8 shrink-0 items-stretch justify-end text-xs",
2303+
"group/sidebar-status-slot ml-auto grid h-5 min-w-8 shrink-0 items-stretch justify-end text-xs",
23032304
props.sweepAction !== null && "hidden",
23042305
)}
23052306
>
23062307
<span
23072308
className={cn(
23082309
isWokeStatus
23092310
? "pointer-events-auto"
2310-
: "pointer-events-none group-has-[:focus-visible]/sidebar-status-slot:absolute group-has-[:focus-visible]/sidebar-status-slot:right-0 group-has-[:focus-visible]/sidebar-status-slot:opacity-0 group-any-hover/sidebar-row:absolute group-any-hover/sidebar-row:right-0 group-any-hover/sidebar-row:opacity-0",
2311-
"flex items-center self-center justify-self-end tabular-nums text-secondary-label transition-opacity",
2312-
snoozeMenuOpen && "pointer-events-none absolute right-0 opacity-0",
2311+
: "pointer-events-none group-has-[:focus-visible]/sidebar-status-slot:opacity-0 group-any-hover/sidebar-row:opacity-0",
2312+
"flex items-center self-center justify-self-end tabular-nums text-secondary-label transition-opacity [grid-area:1/1]",
2313+
snoozeMenuOpen && "pointer-events-none opacity-0",
23132314
)}
23142315
>
23152316
{topStatus ? (
@@ -2380,8 +2381,9 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
23802381
// would keep the controls pinned over the status label
23812382
// once the pointer moves away (e.g. after a failed
23822383
// settle) instead of cross-fading back.
2383-
"pointer-events-none absolute inset-y-0 right-0 flex items-stretch opacity-0 transition-opacity has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:static has-[:focus-visible]:opacity-100 group-any-hover/sidebar-row:pointer-events-auto group-any-hover/sidebar-row:static group-any-hover/sidebar-row:opacity-100",
2384-
snoozeMenuOpen && "pointer-events-auto static opacity-100",
2384+
"pointer-events-none flex items-stretch justify-self-end opacity-0 transition-opacity has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100 group-any-hover/sidebar-row:pointer-events-auto group-any-hover/sidebar-row:opacity-100",
2385+
isWokeStatus ? "[grid-area:1/2]" : "[grid-area:1/1]",
2386+
snoozeMenuOpen && "pointer-events-auto opacity-100",
23852387
)}
23862388
>
23872389
{hasUnsentDraft ? (

0 commit comments

Comments
 (0)