Clip the sidebar shimmer wash to the chat name

The glyph overlay clips to text by construction, but the new highlight
wash is a box on the span — and the span is flex-1, so short names
swept a full-row highlight. The shimmer now lives on an inner
inline-block sized to the text (self-truncating, so the overlay
ellipsis stays aligned); the outer span keeps the row layout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
klopez4212
2026-07-05 08:35:16 +01:00
parent 2f4867619f
commit 1f923a89ef

View File

@@ -82,17 +82,20 @@ export function ChatListItem({
onClick={() => onSelectChat(chat.id)}
type="button"
>
<span
className={cn(
"min-w-0 flex-1 truncate font-medium",
// Shimmer class + overlay live on the truncating span itself
// (same pattern as MarkerLabel) so long names keep their
// ellipsis while the band sweeps the visible text.
isAgentRunning && "buzz-shimmer buzz-shimmer-accent",
)}
data-shimmer-text={isAgentRunning ? name : undefined}
>
{name}
<span className="min-w-0 flex-1 truncate font-medium">
{/* Shimmer lives on an inner inline-block sized to the TEXT (the
outer span is flex-1 = full row, and the highlight wash would
otherwise sweep the whole row). The inner truncates itself so
the overlay's ellipsis stays aligned with the visible text. */}
<span
className={cn(
"max-w-full truncate align-bottom",
isAgentRunning && "buzz-shimmer buzz-shimmer-accent inline-block",
)}
data-shimmer-text={isAgentRunning ? name : undefined}
>
{name}
</span>
</span>
{isPinned ? (
<Pin