30 Commits

Author SHA1 Message Date
xfy
acd6ff5236 Lock rowHeightPx during collapse animation
Add lockedRowHeightPx state that is only updated when fully expanded
(p < 0.01f). During collapse, rowHeightPx uses the locked value instead
of recalculating from the shrinking container height, which was causing
rowH to drop from 137→0 and gridH to become 0 at p=1.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 00:15:21 +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
bacc2bc8dc Use primaryContainer colors when today is also selected
Distinguish the selected-today state from regular selection by using
primaryContainer/onPrimaryContainer instead of primary/onPrimary,
providing a softer visual treatment for the combined state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:53:33 +08:00
xfy
de8cb4334b Use border outline instead of filled background for today indicator
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:50:25 +08:00
xfy
fae5908990 Prefer today over first-day when selecting date on page change
When swiping to a different month or week, select today if it falls
within the target period instead of always picking the 1st or Monday.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:42:07 +08:00
xfy
e5d7efd603 Skip initial snapshotFlow emission in pagers to preserve today selection
Adding .drop(1) prevents the settledPage flow from firing on initial
composition, which would override the "today" date selection.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:37:27 +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
a476ff01fc Add bottom padding to WeekdayHeader and account for it in collapse offset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:24:56 +08:00
xfy
c1e0484cba Add pull-down gesture to expand from collapsed week view back to month view
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:02:44 +08:00
xfy
1c232762b1 Clip pager to bounds during collapse animation to prevent content overflow
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 16:55:04 +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
0b9a516ed3 Fix BottomCard positioning by tracking expanded calendar height separately
Use expandedCalendarHeightPx to preserve full height during collapse animation,
and compute cardTopPx based on collapse state instead of offset arithmetic.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:13:45 +08:00
xfy
f64a1c1851 Simplify BottomCard positioning with cardTopPx calculation instead of offset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 14:48:05 +08:00
xfy
0bc5057986 Replace Column weight layout with Box absolute positioning for BottomCard collapse animation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 14:44:45 +08:00
xfy
b734e26645 Replace button-triggered collapse with vertical drag gesture
ViewModel now exposes onDrag/onDragEnd so BottomCard drives the
collapse animation via detectVerticalDragGestures instead of a
discrete collapse() call. Drag maps to 0–1 progress over 200dp;
on release the animatable snaps to the nearest end with spring.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 14:39:50 +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
9424c518f3 Move horizontal padding from MonthHeader to CalendarMonthView outer column
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:52:13 +08:00
xfy
d7f09fb1f7 Add status bars padding and refine month header layout
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:49:01 +08:00
xfy
eb8b16047a Implement swipeable month view with HorizontalPager and assemble app
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:29:18 +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
xfy
00a24e58fd Add MonthHeader, WeekdayHeader, and DayCell UI components
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:20:32 +08:00
xfy
298631c8b5 Add CalendarViewModel with ISO week calculation and month grid generation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:18:49 +08:00
xfy
2c0a63e930 Add kotlinx-datetime dependency for date handling
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:11:33 +08:00
xfy
07f6b779c6 Refactor KMP project structure for AGP 9.0 compatibility
Split composeApp into shared (KMP library) and androidApp (Android application)
modules to resolve KMP + AGP 9.0 incompatibility. Remove deprecated gradle
properties and add performance optimization settings.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 11:47:26 +08:00