Skip to content

Commit c3749f6

Browse files
authored
Merge pull request #11 from firstsun-dev/worktree-fluttering-orbiting-crescent
fix(dashboard): align week-selector dot order with arrow direction
2 parents 120b151 + efd7107 commit c3749f6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

dashboard/src/components/patterns/WeekSelector.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,16 @@ export function WeekSelector({ currentWeek, weeks, onWeekChange }: WeekSelectorP
106106
Arrow navigation works across all weeks; dots are supplementary.
107107
When the current week is outside the 8-dot window (user is browsing old history),
108108
include it in the visible slice so the active dot is always shown.
109+
`weeks` is sorted most-recent-first, but the left arrow moves to older weeks
110+
and the right arrow to newer ones, so the slice is reversed here to render
111+
oldest-on-the-left/newest-on-the-right -- matching the arrow directions.
109112
tabIndex={-1} keeps dots out of the tab order while keeping them mouse-clickable. */}
110113
{weeks.length > 0 && (
111114
<div className="flex items-center gap-1">
112115
{(weeks.slice(0, 8).some(w => w.week === currentWeek)
113116
? weeks.slice(0, 8)
114117
: [...weeks.slice(0, 7), weeks.find(w => w.week === currentWeek)].filter(Boolean) as typeof weeks
115-
).map((w) => {
118+
).slice().reverse().map((w) => {
116119
const isCurrent = w.week === currentWeek;
117120
const dotBounds = parseIsoWeekBounds(w.week);
118121
const label = dotBounds

0 commit comments

Comments
 (0)