Skip to content

feat(calendar): use global right sidebar in Day view - #266

Merged
h4yfans merged 2 commits into
mainfrom
musing-hopper-cb83a1
Apr 17, 2026
Merged

feat(calendar): use global right sidebar in Day view#266
h4yfans merged 2 commits into
mainfrom
musing-hopper-cb83a1

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

What

Delete the in-page right sidebar (mini calendar + "Today's events") from the Calendar Day view and drive the app's global right sidebar instead. The global sidebar auto-opens when the user enters Day view and auto-closes when leaving — unless the user had opened it manually, in which case it stays open (sticky user intent).

Why

Having two sidebars showing the same information (mini calendar + day events) was redundant and inconsistent. Calendar already relies on the global right sidebar elsewhere; Day view is now aligned with that pattern.

How

  • DayPanelContext gains two new actions: openForDayView(date) and closeForDayView(). An internal autoModeRef (non-reactive useRef) tracks whether the current open state came from Day-view auto-open vs. a manual user action. Manual open / close / toggle always clear auto-mode so the user's explicit intent wins.
  • openForDayView is a no-op when the panel is already open (preserves the sticky-user-open case). closeForDayView only closes when auto-mode is true.
  • CalendarPage wires two small effects: one toggles the panel on view transitions; the other syncs selectedDate to anchorDate while in Day view so the global panel follows Prev/Next/Today navigation.
  • CalendarDayView loses its <CalendarMiniMonth> + "Today's events" column, plus the now-dead miniMonthAnchor state and onAnchorChange prop (confirmed dead — shell never forwarded it to Day view).
  • The timedItems filter keeps the original toLocalDateKey(startAt) === anchorDate && !isAllDay guard so events spilling in from adjacent days are not rendered on the grid.

Trade-off: chose two useEffects over wiring setDate into every anchorDate mutator (Prev/Next/Today/onAnchorChange). Effects add one lint warning but stay robust if a future change introduces a new anchor-date path.

Type

  • feat — new feature
  • fix — bug fix
  • refactor — restructure without behavior change
  • style — visual/UI only
  • perf — performance improvement
  • test — adding or updating tests
  • chore — tooling, deps, config
  • docs — documentation only
  • ci — CI/CD changes

Test plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing (describe below)

Manual scenarios to walk through in pnpm dev:

  1. Panel starts closed → Navigate to Calendar (Month). Click Day ⇒ global sidebar opens showing anchorDate. Click Week ⇒ closes. Click Day ⇒ opens again.
  2. Panel starts manually open (user clicked the global toggle) → Navigate to Calendar. Click Day ⇒ stays open. Click Weekstays open (sticky). Close manually → click Day ⇒ opens in auto-mode → click Month ⇒ closes.
  3. Date sync in Day view → Use Prev/Next/Today; confirm the global sidebar's mini-calendar and day-events follow the calendar's anchorDate.
  4. Reload while Day view is auto-open → Panel persists as open via localStorage and is treated as user-opened after reload (safe default); switching to Week keeps it open.

Checklist

  • Self-reviewed the diff
  • No hardcoded secrets or credentials
  • Files stay under ~500 LOC
  • Follows immutable data patterns

h4yfans added 2 commits April 17, 2026 23:06
Delete the in-page right sidebar (mini calendar + today's events) from
Calendar Day view and drive the global right sidebar instead. Add
openForDayView/closeForDayView to DayPanelContext with an autoMode flag
so a manually-opened panel stays sticky across view changes, while a
Day-view-triggered auto-open closes when the user leaves Day view.
@h4yfans
h4yfans merged commit c93a2c5 into main Apr 17, 2026
5 checks passed
@h4yfans
h4yfans deleted the musing-hopper-cb83a1 branch April 17, 2026 20:17
h4yfans added a commit that referenced this pull request Apr 17, 2026
PR #266 (d692b64) removed the in-page right sidebar that previously
surfaced all-day projected items (tasks, reminders, user-created
all-day events). The replacement global Day Panel is a fixed sibling
of the calendar page, so all-day items vanished from the Day view's
main surface — breaking standard calendar UX (create all-day event,
it disappears) and shard 1/3 e2e (Due launch brief not found inside
[data-testid=calendar-page]).

Render a compact "All day" strip above the hour grid, inside the
calendar-view testid, using the existing CalendarItemChip.
h4yfans added a commit that referenced this pull request May 6, 2026
h4yfans added a commit that referenced this pull request May 6, 2026
feat(calendar): use global right sidebar in Day view
h4yfans added a commit that referenced this pull request May 6, 2026
PR #266 (d692b64) removed the in-page right sidebar that previously
surfaced all-day projected items (tasks, reminders, user-created
all-day events). The replacement global Day Panel is a fixed sibling
of the calendar page, so all-day items vanished from the Day view's
main surface — breaking standard calendar UX (create all-day event,
it disappears) and shard 1/3 e2e (Due launch brief not found inside
[data-testid=calendar-page]).

Render a compact "All day" strip above the hour grid, inside the
calendar-view testid, using the existing CalendarItemChip.
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