From b877596e72fdb007a9ca3ab6f7854df6f07a62cc Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 18 May 2026 11:35:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20CLAUDE.md:=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E7=89=88=E6=9C=AC=E5=8F=B7=E3=80=81=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=84=E4=BB=B6=E5=92=8C=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - compileSdk/targetSdk 36→37, Compose 1.10.3→1.11.0 - 新增 tyme4kt 农历库依赖 - 补充 YearGridView、ShiftPattern、CalendarUtils 说明 Co-Authored-By: Claude Opus 4.7 --- CLAUDE.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7e58e99..42b889b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,9 +47,15 @@ CalendarMonthView ← top-level screen (MonthHeader + WeekdayHeader + p │ └── DayCell ← single day circle with selection/today states ├── WeekPager ← HorizontalPager for single-week view (collapsed state) │ └── DayCell + ├── YearGridView ← 4×3 mini-month grid with year navigation (year view) + │ └── MiniMonth ← compact month: title + weekday row + day numbers └── BottomCard ← drag handle card, drives collapse/expand gestures ``` +`ShiftPattern` (in `plus.rua.project`) defines personal shift cycles (WORK/OFF) independent of public holidays. Uses modular arithmetic: `(date - anchorDate) mod cycle.size`. + +`CalendarUtils` (in `plus.rua.project.ui`) holds pager constants (`START_PAGE = Int.MAX_VALUE/2`, `COLLAPSE_THRESHOLD = 0.25f`) and page↔date arithmetic (`pageToYearMonth`, `yearMonthToPage`, `pageToWeekMonday`). + **Collapse/expand animation:** `CalendarMonthView` supports month↔week transition via `CalendarViewModel.collapseProgress` (0f=month, 1f=week). `BottomCard` captures vertical drag gestures and calls `viewModel.onDrag()`/`onExpandDrag()`. When progress crosses 50% on release, a spring animation snaps to the nearest state. `CalendarMonthPage` compresses non-selected weeks toward zero height during collapse. When fully collapsed, `WeekPager` replaces `CalendarPager` for efficient single-week paging. **Pager page mapping:** Both `CalendarPager` and `WeekPager` use `Int.MAX_VALUE` pages centered at `Int.MAX_VALUE / 2`. Page-to-date conversion is arithmetic — no index-based list. `CalendarPager` maps pages to yearMonth; `WeekPager` maps pages to week-Monday dates. Both skip the initial `snapshotFlow` emission (`.drop(1)`) to preserve the "today" selection on first render. @@ -58,9 +64,10 @@ CalendarMonthView ← top-level screen (MonthHeader + WeekdayHeader + p ## Key Dependencies -- Kotlin 2.3.21, Compose Multiplatform 1.10.3, Material 3 1.10.0-alpha05 +- Kotlin 2.3.21, Compose Multiplatform 1.11.0, Material 3 1.10.0-alpha05 - `kotlinx-datetime` 0.8.0 for all date logic (no java.util.Calendar) -- AGP 9.2.1, compileSdk/targetSdk 36, minSdk 24 +- `tyme4kt` for Chinese traditional calendar (lunar dates, solar terms, festivals) +- AGP 9.2.1, compileSdk/targetSdk 37, minSdk 24 - JVM target: 17 ## Conventions