Skip to content
TypeScript

fix(web): sidebar jump hints are readable and sit in the status slot (#26112)

G-R31dacdb946006
diff --git a/apps/web/src/components/sidebar/SidebarThreadRow.tsx b/apps/web/src/components/sidebar/SidebarThreadRow.tsx
index bc89186d937..fc47fd8e21a 100644
--- a/apps/web/src/components/sidebar/SidebarThreadRow.tsx
+++ b/apps/web/src/components/sidebar/SidebarThreadRow.tsx
@@ -109,6 +109,7 @@ import { getTriggerDisplayModelName } from "../chat/providerIconUtils";
import { shouldShowInstanceBadge, type ProviderInstanceEntry } from "../../providerInstances";
import { useThreadRunningTerminalIds } from "../../state/terminalSessions";
import { InlineButton } from "../ui/button";
+import { Kbd } from "../ui/kbd";
import { Menu, MenuItem, MenuPopup, MenuSeparator, MenuShortcut, MenuTrigger } from "../ui/menu";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import { MiddleTruncate } from "../ui/middle-truncate";
@@ -150,15 +151,15 @@ function threadTimeTimestamp(thread: SidebarThreadSummary): string {
function JumpHintBadge(props: { label: string }) {
return (
- <span
- aria-hidden
- className="pointer-events-none 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-3xs font-medium tracking-tight text-foreground shadow-sm"
- >
+ <Kbd aria-hidden data-jump-hint>
{props.label}
- </span>
+ </Kbd>
);
}
+const JUMP_HINT_SLOT_CLASS_NAME =
+ "[&>:not([data-jump-hint])]:invisible [&>:not([data-jump-hint])]:absolute";
+
function WorkingDuration(props: { startedAt: string | null }) {
const startedMs = props.startedAt !== null ? Date.parse(props.startedAt) : Number.NaN;
if (Number.isNaN(startedMs)) return null;
@@ -931,6 +932,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
// Closing here, not just masking, keeps the menu from reopening when the button returns.
if (snoozeMenuOpenRaw && !showSnoozeButton) setSnoozeMenuOpen(false);
const snoozeMenuOpen = snoozeMenuOpenRaw && showSnoozeButton;
+ const jumpHintLabel = snoozeMenuOpen ? null : props.jumpLabel;
const handlePrClick = (event: ReactMouseEvent<HTMLElement>, targetUrl?: string) => {
const url = targetUrl ?? pr?.url ?? currentLinkedPr?.url;
if (!url) return;
@@ -1262,6 +1264,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
className={cn(
"relative ml-auto flex h-6 min-w-8 shrink-0 items-center justify-end",
props.sweepAction !== null && "hidden",
+ jumpHintLabel && JUMP_HINT_SLOT_CLASS_NAME,
)}
>
<span
@@ -1372,12 +1375,12 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
<TooltipPopup side="top">Settle thread</TooltipPopup>
</Tooltip>
)}
+ {jumpHintLabel ? <JumpHintBadge label={jumpHintLabel} /> : null}
</span>
)}
{props.sweepAction !== null ? dragDestination : null}
</div>
{multiline ? metaLine : null}
- {props.jumpLabel ? <JumpHintBadge label={props.jumpLabel} /> : null}
</TooltipTrigger>
{detailsTooltip}
</Tooltip>
@@ -1448,6 +1451,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
className={cn(
"group/sidebar-status-slot relative ml-auto flex h-5 min-w-8 shrink-0 items-stretch justify-end text-xs",
props.sweepAction !== null && "hidden",
+ jumpHintLabel && JUMP_HINT_SLOT_CLASS_NAME,
)}
>
<span
@@ -1563,6 +1567,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
) : null}
</span>
) : null}
+ {jumpHintLabel ? <JumpHintBadge label={jumpHintLabel} /> : null}
</span>
)}
{props.sweepAction !== null ? dragDestination : null}
@@ -1578,7 +1583,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
</div>
{metaLine}
</div>
- {props.jumpLabel ? <JumpHintBadge label={props.jumpLabel} /> : null}
</TooltipTrigger>
{detailsTooltip}
</Tooltip>