History

Make changed-files header sticky in chat timeline (#2565)

Julius Marminge committed 6 months ago

Commit 449e1aa1 parent 22384ae1 file · +2 −2Browse files

Unified · Split

apps/web/src/components/chat/MessagesTimeline.tsx+2−2
@@ -234,7 +234,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({ · 233 unmodified lines
234 // from TimelineRowCtx, which propagates through LegendList's memo.234 // from TimelineRowCtx, which propagates through LegendList's memo.
235 const renderItem = useCallback(235 const renderItem = useCallback(
236 ({ item }: { item: MessagesTimelineRow }) => (236 ({ item }: { item: MessagesTimelineRow }) => (
237 <div className="mx-auto w-full min-w-0 max-w-3xl overflow-x-hidden" data-timeline-root="true">237 <div className="mx-auto w-full min-w-0 max-w-3xl overflow-x-clip" data-timeline-root="true">
238 <TimelineRowContent row={item} />238 <TimelineRowContent row={item} />
239 </div>239 </div>
240 ),240 ),
@@ -663,7 +663,7 @@ function AssistantChangedFilesSectionInner({ · 422 unmodified lines
663 663
664 return (664 return (
665 <div className="mt-2 rounded-lg border border-border/80 bg-card/45 p-2.5">665 <div className="mt-2 rounded-lg border border-border/80 bg-card/45 p-2.5">
666 <div className="mb-1.5 flex items-center justify-between gap-2">666 <div className="sticky top-2 z-10 mb-1.5 flex items-center justify-between gap-2 bg-background before:absolute before:inset-x-0 before:-top-2 before:h-2 before:bg-background before:content-['']">
667 <p className="text-[10px] uppercase tracking-[0.12em] text-muted-foreground/65">667 <p className="text-[10px] uppercase tracking-[0.12em] text-muted-foreground/65">
668 <span>Changed files ({changedFileCountLabel})</span>668 <span>Changed files ({changedFileCountLabel})</span>
669 {hasNonZeroStat(summaryStat) && (669 {hasNonZeroStat(summaryStat) && (