Commit Graph

4 Commits

Author SHA1 Message Date
zikai
1c6ecf9d86 refactor: 移除重做/应用按钮, 自动应用更改, 删除死代码, 修复性能问题
UI 变更:
- 移除重做按钮及 redo/canRedo/redoStack 相关逻辑 (useCalendar, HeaderBar)
- 移除应用更改按钮, EventDetail 改为 watch form 自动应用 (deep watch)
- 用 syncing 标志防止 syncForm 回写时触发自动应用的循环

死代码清理:
- weekday.js: 移除未使用的 BYDAY_TO_INDEX 和 dowLabel
- date.js: 移除未使用的 toHHMM
- App.vue: 移除未使用的 .empty CSS
- DropZone.vue: 移除空的 .icon 容器及 CSS
- test/weekday.test.js: 移除对应死代码的 2 个测试用例

性能修复:
- WeekPreview: layoutEvents 从模板内联调用改为 computed (laidOutByDate),
  避免每次渲染重新计算布局
- MonthPreview: occByDate 过滤为仅网格内 42 天, 避免展开全部 occurrence

代码质量:
- useCalendar: prevMonth/nextMonth 合并为 shiftMonth(delta), 消除重复
- WeekPreview/MonthPreview: 移除未使用导入 (toISODate, toDate)
2026-07-22 04:18:05 +00:00
zikai
f4c11bdc3e feat: 新增视图切换状态管理及颜色/日期工具
- date.js: 新增 startOfWeek, startOfMonth, hhmmToMinutes 辅助函数
- colors.js (新增): 基于 uid 哈希的事件颜色分配, 12 色调色板
- useCalendar.js: 新增 viewMode (edit/month/week) 和 previewDate 状态,
  以及 setViewMode/prevMonth/nextMonth/prevWeek/nextWeek 操作
2026-07-22 04:04:29 +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
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