fix(calendar): color and click adjacent-month days in month view#5858
fix(calendar): color and click adjacent-month days in month view#5858costajohnt wants to merge 1 commit intousememos:mainfrom
Conversation
Previously, days shown from the surrounding months (to fill the first/last grid row) rendered as a plain muted div with no heatmap color and no click handler. Users with memos on the last days of the prior month — visible in the first week of the current month's grid — saw those cells uncolored, indistinguishable from empty days, and could not click through to the memos created on that date. The fix lets non-current-month days pass through the normal interactive rendering path with count-based intensity, tooltip, and click-to-filter. An opacity-60 class preserves a visual distinction from current-month days so the grid-alignment signal isn't lost. Closes usememos#5816.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRemoves special handling for adjacent-month calendar cells that previously rendered them as non-interactive plain divs. These cells now follow the standard interactive button structure with intensity styling applied based on activity count, while maintaining visual muting through an opacity class. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #5816.
Problem
Days shown from adjacent months (to fill the first/last week of the month grid) rendered as plain muted divs with no heatmap color and no click handler. Memos created on the last few days of the previous month — which appear in the current month's first grid row — looked indistinguishable from empty days, and couldn't be clicked through to their date filter.
Bug reported by @bordam with screenshots in #5816.
Fix
CalendarCell.tsx: removed the!day.isCurrentMonthearly-return that was rendering adjacent-month days as plain divs. They now flow through the normal button path with intensity class, tooltip, and click handler.utils.ts: removed the!day.isCurrentMonthcheck fromgetCellIntensityClassso intensity is count-based regardless of month.opacity-60to adjacent-month cells so a visual distinction from current-month cells is preserved — adjacent-month days are still clearly secondary in the grid.The count lookup (
data[isoDate] ?? 0) and click chain (navigateToDateFilter→?filter=displayTime:YYYY-MM-DD) already worked correctly for arbitrary dates; the data map isn't scoped to the visible month. Only the render path was gating these days out.Test plan
pnpm lint(tsc + biome) — cleanpnpm build— clean29 30 31(March days) colored with heatmap intensity/home?filter=displayTime:2026-03-29and the March 29 memo loadsaria-label="1 memo in 2026-03-29",tabindex=0,opacity-60class, and the expectedbg-primary*intensity classday.isCurrentMonthis true)Notes
YearCalendaruses the same component. Adjacent-month days across the year boundary (Jan card showing Dec of prior year, Dec card showing Jan of next year) getcount=0fromfilterDataByYearand render as EMPTY with opacity-60 — unchanged visual. Within the same year, an adjacent-month day with memos will appear colored in both its own card and the neighboring card. That's a minor visual duplication but internally consistent with how the grids have always worked, and matches the fix's intent of never hiding a day with memos behind a grid boundary.opacity-60preserves the "this isn't the current month" signal that the concern was really about.web/src. Verified manually via dev server + type check + build.Summary by CodeRabbit