mirror of
https://github.com/block/buzz.git
synced 2026-11-02 15:31:27 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user