Commit Graph

23 Commits

Author SHA1 Message Date
zikai
a475315eb7 fix: 解析 ICS 时缺失 UID 导致全部日程被同时选中
ical-io.js 中 UID 缺失时回退为空字符串, 导致所有事件共享 uid='',
EventList 的 active 判断和 selectedEvent 的 find() 全部命中第一个事件。
改为缺失时调用 genUUID() 生成唯一 UID。
2026-07-22 04:02:43 +00:00
zikai
84dbaf9cd2 style: 移除 emoji, 注释改为中文 (保留专业名词)
- 移除所有 Vue 组件和 README 中的 emoji (按钮文字、标题、功能列表)
- 将 src 下所有英文注释改为中文, 保留专业名词 (RRULE, EXDATE, ICS 等)
- 涉及文件: date.js, event-factory.js, ical-io.js, organize.js,
  recur.js, split.js, weekday.js, useCalendar.js, EventDetail.vue,
  App.vue, DropZone.vue, EventList.vue, HeaderBar.vue, README.md
2026-07-22 02:55:45 +00:00
zikai
e9fc10c89d fix: WEEKLY 事件的 BYDAY 与 dtstartDate 不一致导致 ICS 输出错误
applyChanges 中 BYDAY 此前取自表单下拉框(默认 'MO'), 与 dtstartDate
的星期可能不一致。expandOccurrences 按 dtstartDate 展开 occurrence,
但序列化的 RRULE 写入表单选择的 BYDAY, 两者不匹配时日历应用会显示
错误的星期。

修复: BYDAY 始终由 dtstartDate 的星期自动推导(bydayFromDate), 下拉框
改为只读展示。确保 RRULE BYDAY 与实际 occurrence 日期始终一致。
2026-07-22 02:45:04 +00:00
zikai
4a2c53204f fix: crypto.randomUUID 在非安全上下文(非HTTPS)下崩溃
新增 src/lib/uuid.js 提供 genUUID(), 优先使用 crypto.randomUUID,
不可用时回退到 getRandomValues 手动拼装 v4 UUID, 最终回退到 Math.random。

原因: crypto.randomUUID() 仅在安全上下文(HTTPS 或 localhost)可用。
当前站点通过 http://f.zikai.wang:8888 访问, 属于非安全上下文,
导致 event-factory.js 的新增日程和 split.js 的拆分事件功能崩溃。

涉及文件:
- src/lib/uuid.js (新增): 带 fallback 的 UUID 生成
- src/lib/event-factory.js: crypto.randomUUID -> genUUID
- src/lib/split.js: crypto.randomUUID -> genUUID
2026-07-22 02:43:29 +00:00
zikai
6997f7a708 docs: 精简 README, 补充 Ubuntu 安装与 systemd 部署说明
- 重写 README 为精简版, 包含项目结构/Ubuntu 从零安装/启动关闭使用说明
- vite.config.js 添加 preview.allowedHosts 允许 f.zikai.wang 域名访问
- package-lock.json 随 npm 版本差异更新
2026-07-22 02:27:24 +00:00
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
e4f549f848 docs: add README 2026-07-13 18:53:39 +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
15b6f30896 feat: add EventDetail with edit form, occurrence grid, split 2026-07-13 18:43:28 +08:00
timeTable2 dev
8a1d547001 feat: add OccurrenceGrid component 2026-07-13 18:41:51 +08:00
timeTable2 dev
f52f5315e6 feat: add EventList and HeaderBar with organize/undo/download 2026-07-13 18:40:44 +08:00
timeTable2 dev
906679fc11 feat: add DropZone and App layout skeleton 2026-07-13 18:39:15 +08:00
timeTable2 dev
361cc38384 feat: add central store with snapshot undo/redo 2026-07-13 18:37:58 +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
timeTable2 dev
f64c0a2a10 feat: scaffold Vite + Vue3 project with npmmirror 2026-07-13 18:21:17 +08:00
timeTable2 dev
1affa0b021 docs: add implementation plan 2026-07-13 18:18:23 +08:00
timeTable2 dev
64dd8c5cd1 docs: add timeTable2 design spec 2026-07-13 17:31:43 +08:00