Commit Graph

9 Commits

Author SHA1 Message Date
timeTable2 dev
51461ff5f2 fix: use JSON clone instead of structuredClone for Vue reactive proxies
structuredClone cannot clone Vue reactive Proxy objects (DataCloneError).
EventModel contains only plain data, so JSON round-trip is safe and
lossless. Verified: organize, toggle, undo, download all work correctly.
2026-07-13 20:13:19 +08:00
timeTable2 dev
b352c4e116 refactor: high-cohesion low-coupling cleanup across store and components
ical-io.js:
- Import pad2/parseISODate from date.js (remove local duplicates)
- Rename ICAL.Time helpers to icalTimeTo* for clarity

useCalendar.js:
- Delegate addEvent to createEvent() factory
- Delegate splitEvent to splitRecurringEvent() pure function
- Use cloneEvent() instead of JSON.parse(JSON.stringify())
- Add selectEvent() action (components no longer mutate state.selectedUid directly)

Components:
- EventList: use selectEvent action + toDate() from date.js
- HeaderBar: destructure loadFile at top level (was re-calling useCalendar in handler)
- EventDetail: import DOW from weekday.js (was inlining the array)
- OccurrenceGrid: use toDate() from date.js
2026-07-13 20:06:00 +08:00
timeTable2 dev
02cfdda900 refactor: extract date.js, event-factory.js, split.js; use shared date helpers in recur/organize
- date.js: single source of truth for ISO date formatting/arithmetic
  (toISODate, parseISODate, addDays, daysBetween, todayISO, nowCompactTimestamp)
- event-factory.js: createEvent/cloneEvent (structuredClone with JSON fallback)
- split.js: splitRecurringEvent pure function using intervalDays from recur.js
- recur.js: replaced local toISO() and inline Date math with date.js helpers
- organize.js: replaced inline date formatting and gap math with date.js helpers,
  extracted buildGrid() helper and byDate comparator
2026-07-13 20:01:10 +08:00
timeTable2 dev
3af6b856e3 fix: store VTIMEZONEs as raw jCal arrays for Vue reactivity safety
ICAL.Component instances break when wrapped by Vue's reactive proxy
(the .jCal getter returns undefined through the proxy, causing
serializeICS to crash with 'Cannot read properties of undefined').
Storing vtz.jCal (plain arrays) instead makes meta fully serializable
for both reactivity and JSON snapshot cloning.
2026-07-13 18:53:01 +08:00
timeTable2 dev
dc70a04b54 feat: port GCD dedup algorithm from ical_organizer.py 2026-07-13 18:36:29 +08:00
timeTable2 dev
e187337127 feat: add recurrence grid expansion 2026-07-13 18:32:46 +08:00
timeTable2 dev
7e708932b1 feat: implement serializeICS with round-trip support 2026-07-13 18:30:52 +08:00
timeTable2 dev
138b89e3bf feat: implement parseICS with ical.js 2026-07-13 18:26:14 +08:00
timeTable2 dev
76e08d67d8 feat: add weekday constants and helpers 2026-07-13 18:22:57 +08:00