12 Commits

Author SHA1 Message Date
xfy
7e2bb048f6 Unify row height source in CalendarMonthPage
Replace internal rowHeightPx measurement with external rowHeightPx
parameter passed from CalendarMonthView. This eliminates the mismatch
between outer gridHeightPx (based on shrinking container) and inner
totalHeightDp (based on independently measured row height), which was
causing visual jitter during collapse animation.

Remove onRowHeightMeasured callback, TAG constant, and debug printlns
from CalendarMonthPage as part of this refactor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 00:17:00 +08:00
xfy
b94b264d5c Use dynamic row count (4/5/6) for calendar grid instead of fixed 6 rows
Calculate actual weeks needed per month and interpolate row count during
page swipe so BottomCard follows the grid height smoothly. Remove debug
println statements.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 18:31:29 +08:00
xfy
1cf2766e84 Increase row padding to 4dp and auto-select date on page change
Select the Monday of the week when WeekPager changes, and the 1st of
the month when CalendarPager changes, so the selected date always
matches the visible page.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:32:08 +08:00
xfy
151b15d09e Replace Column layout with Box+manual y-offset for collapse animation
Switch CalendarMonthPage from Column to Box with calculated y positions per row,
enabling precise height computation that aligns with CalendarMonthView's
BottomCard positioning. Simplify cardTopPx calculation by deriving grid height
from the same formula instead of tracking expandedCalendarHeightPx separately.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 16:49:45 +08:00
xfy
2fb36168a3 Change collapse animation to shrink non-selected rows instead of overlaying
Non-selected rows now compress their height proportionally with
collapse progress, replacing the previous overlay-based approach.
Remove KDoc that described the old overlay behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:50:22 +08:00
xfy
a44ef44b42 Refactor collapse animation to overlay selected row instead of shrinking rows
Selected row now moves up via offset + zIndex to cover other rows, which
stay in place. Collapse offset calculation excludes MonthHeader and
WeekdayHeader heights so only the grid portion is collapsed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:44:00 +08:00
xfy
edf8ea9851 Fix first-frame flicker by deferring row height until measured
When rowHeightPx is 0 (first frame), use aspectRatio-based natural
height instead of collapsing to 0.dp, preventing a visible flash.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:27:26 +08:00
xfy
d7552e469f Add KDoc and inline comments per COMMENTS.md conventions
- Add KDoc to all public Composable functions with parameter descriptions
- Add inline comments for non-obvious algorithms (42-cell grid, pager mapping)
- Add @Suppress reason comments for monthNumber deprecation
- Document collapseProgress range and physical meaning
- Add named constant comments for START_PAGE
- Add Preview name to App()

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:22:49 +08:00
xfy
35cbcaf430 Move collapse animation from animateFloatAsState to ViewModel Animatable with spring spec
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 14:32:43 +08:00
xfy
e53c3d8705 Add week/month view toggle with collapse animation and bottom card
Add isCollapsed/collapseProgress state to CalendarViewModel for toggling
between month and week views. CalendarMonthPage animates non-selected
weeks out with offset and alpha. Introduce WeekPager for single-week
HorizontalPager and BottomCard with drag-to-collapse gesture.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 14:28:05 +08:00
xfy
f3191aeac9 Move WeekdayHeader out of pager to keep it fixed across pages
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:56:15 +08:00
xfy
edf881d1cc Add CalendarMonthPage with 6x7 day grid layout
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:21:38 +08:00