Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions resources/js/components/activity-graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,15 @@ function WeekGrid({
};

return (
<div
ref={(node) => {
if (node) {
node.scrollLeft = node.scrollWidth;
}
}}
className="overflow-x-auto pb-1"
>
// A year scrolls right to left, so a phone opens on the latest weeks before any script runs; the grid inside reads
// left to right. Half a year fits without scrolling and stays on the left.
<div dir={isYear ? 'rtl' : undefined} className="overflow-x-auto pb-1">
<div
dir="ltr"
role="img"
aria-label={summary}
className={cn(
'grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1.5',
'grid grid-cols-[auto_minmax(0,1fr)] gap-y-1.5',
isYear && 'min-w-136',
)}
style={
Expand All @@ -455,7 +451,7 @@ function WeekGrid({
}
}
>
<span aria-hidden />
<span aria-hidden className="sticky left-0 z-1 bg-card" />
<div
aria-hidden
className="grid text-xs text-muted-foreground"
Expand All @@ -473,7 +469,7 @@ function WeekGrid({

<div
aria-hidden
className="grid grid-rows-7 gap-[3px] text-xs text-muted-foreground"
className="sticky left-0 z-1 grid grid-rows-7 gap-[3px] bg-card pr-2 text-xs text-muted-foreground"
>
{weekdayLabels.map((label, index) => (
<span
Expand Down
Loading