Skip to content

fix(desktop): add compact calendar horizontal scroll#5378

Merged
ComputelessComputer merged 1 commit into
mainfrom
fix/calendar-horizontal-scroll
May 29, 2026
Merged

fix(desktop): add compact calendar horizontal scroll#5378
ComputelessComputer merged 1 commit into
mainfrom
fix/calendar-horizontal-scroll

Conversation

@ComputelessComputer
Copy link
Copy Markdown
Collaborator

@ComputelessComputer ComputelessComputer commented May 29, 2026

Render a snapping horizontal day strip for compact calendar widths while preserving the full month grid.


This is part 3 of 3 in a stack made with GitButler:


Note

Low Risk
UI-only calendar layout and scroll/navigation logic in one component, with no auth, sync, or data-layer changes.

Overview
For narrow calendar layouts (fewer than seven columns), the desktop calendar no longer shows only a fixed cols-wide slice. It now renders a horizontally scrollable day strip with CSS scroll snapping, a hidden scrollbar, and roughly 42 days of history and future around the anchor date so users can swipe through time.

Navigation and header behavior in compact mode are wired to that strip: prev/next advance by cols days via a shared base ref, Today resets scroll state, the title month follows scroll position (compactVisibleStart), and scroll handlers keep the visible start index in sync with snap positions. Full month view (cols === 7) is unchanged—a static weekday header row and month grid with isCurrentMonth dimming.

Reviewed by Cursor Bugbot for commit 6db7b38. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread apps/desktop/src/calendar/components/calendar-view.tsx Outdated
@ComputelessComputer ComputelessComputer force-pushed the fix/calendar-horizontal-scroll branch from 4fe1be4 to 82774ac Compare May 29, 2026 15:25
@ComputelessComputer ComputelessComputer force-pushed the fix/calendar-day-separators branch from 9f2a87c to 7a04f5d Compare May 29, 2026 15:38
@ComputelessComputer ComputelessComputer force-pushed the fix/calendar-horizontal-scroll branch from 82774ac to fc0698b Compare May 29, 2026 15:39
Base automatically changed from fix/calendar-day-separators to main May 29, 2026 16:56
@ComputelessComputer ComputelessComputer force-pushed the fix/calendar-horizontal-scroll branch from fc0698b to 69be584 Compare May 29, 2026 17:01
@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for old-char canceled.

Name Link
🔨 Latest commit 6db7b38
🔍 Latest deploy log https://app.netlify.com/projects/old-char/deploys/6a19cbea73c9bd0008a31607

@ComputelessComputer ComputelessComputer force-pushed the fix/calendar-horizontal-scroll branch from 69be584 to ba9f5eb Compare May 29, 2026 17:08
Comment thread apps/desktop/src/calendar/components/calendar-view.tsx
Render a snapping horizontal day strip for compact calendar widths while preserving the full month grid.
@ComputelessComputer ComputelessComputer force-pushed the fix/calendar-horizontal-scroll branch from ba9f5eb to 6db7b38 Compare May 29, 2026 17:24
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6db7b38. Configure here.

}
compactBaseRef.current = nextStart;
return nextStart;
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side effect in React state updater risks ref desync

Low Severity

The handleCompactScroll callback mutates compactBaseRef.current inside the setCompactVisibleStart updater function. React updater functions are expected to be pure — they may be called multiple times (e.g., in Strict Mode) or their resulting state update could be discarded in concurrent rendering. If the state update is discarded but the ref mutation already happened, compactBaseRef.current diverges from compactVisibleStart. Since advanceCompact reads compactBaseRef.current to determine the next navigation position, this desynchronization could cause prev/next to jump to an unexpected date.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6db7b38. Configure here.

@ComputelessComputer ComputelessComputer merged commit bbe0cf2 into main May 29, 2026
11 checks passed
@ComputelessComputer ComputelessComputer deleted the fix/calendar-horizontal-scroll branch May 29, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant