Commit Graph

15 Commits

Author SHA1 Message Date
lc 05c4763e49 feat(timer): 循环训练组进度改为圆环分段弧 + 信息气泡三行合一
- progress-ring 新增 sets/currentSet/resting/successColor 属性,
  圆环外圈绘制分段弧(已完成=主色/当前=呼吸光点/休息下一组=绿),单组模式零渲染
- timer 删除顶部 circuit-bar 进度面板,布局骨架三模式统一
- 呼吸环淡化(描边 0.55→0.20,柔光渐变强度减半)
- 目标卡与提示气泡合并为 info-bubble,状态文案(撑住/休息中/已暂停)并入气泡顶部
2026-08-12 09:39:41 +08:00
lc 6176f2c341 feat(ui): 记录页月份联动与多项 UI 美化/修复
- records: 底部列表与月份选择器联动,新增 [本月|最近] 分段控件;标题/空态随模式切换
- leaderboard: 领奖台布局(冠军居中+皇冠)、次数标注于底座且三档水平对齐;头像 cloud:// 批量预解析提速(云函数需重新部署)
- index/timer: 主色底图标改白色变体修复隐形;目标数字按微信字体缩放补偿真机遮挡
- settings: 配色方案横滑渐变色卡;头像上传前压缩至 200px
- theme: 新增 teal 主题;暗黑背景统一对齐
- 圆形头像双保险(image 自身 border-radius)修复月/年榜方图

注: cloudfunctions/leaderboard 改动须在开发者工具重新部署才生效。
2026-07-22 09:36:22 +08:00
lc 1eff3d60c4 fix(ui): 多项 UI 修复 — 弹窗遮挡/按钮可见性/暗黑闪烁/云函数版本
- 计划编辑弹窗移出 .container 避免 fixed 降级 + 修复滚动
- dock bottom 40rpx→8rpx 紧贴底部, sheet padding 同步调整
- 计划编辑器取消/恢复默认按钮可见性修复(bg 匹配容器)
- ui-btn--danger 按钮可见性修复
- 清除确认弹窗跟随暗黑模式切换
- icons.js build() 中 Fill 路径覆盖 outlined 路径修复
- plan.js getPlanDay 忽略 customPlans 修复
- darkMode.js 冗余三元简化
- util.js fileToDataURI fallback 可读性提升
- theme.js: BASE_VARS 与 getThemeStyle 统一来源, 去 50ms navbar 延迟
- app.wxss: 移除 page transition 和 background-color 减少闪白
- 云函数 wx-server-sdk 版本统一 ~2.6.3, tts cloud.init 一致化
- 闪白问题: wx.setBackgroundColor 三层防护(onLaunch/applyThemeToPage/switchTab)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-10 09:40:04 +08:00
lc d5121d349f fix(dark): 调亮暗黑色调 + dock 跟随暗黑切换 + 图标文字放大
- theme/app.wxss: 暗黑背景 #0F0F12->#2C2C2E,卡片 #1C1C1E->#3A3A3C,
  bg-soft/border 同步提亮,拉开卡片与背景对比(原太黑看不到卡片)
- custom-tab-bar: dock 注册 wx.onThemeChange,系统切暗黑/明亮实时跟随
  (组件不在 getCurrentPages,app.js watchDarkMode 通知不到)
- custom-tab-bar: 新增 updateTheme,settings 手动切深色时通知 dock
- custom-tab-bar.wxss: dock 图标 44->50rpx,文字 20->23rpx,未激活
  opacity 0.5->0.7(更醒目)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 15:02:17 +08:00
lc afd2b72bcb fix(ui): 根治真机弹窗 fixed 降级(移出 .container + pageIn 去 transform)
根因:.page-enter 的 pageIn 动画含 transform,即使 to: transform:none,
真机 fill-mode 没真正消除 transform,.container 仍是 fixed 的包含块。
记录页内容超一屏时 mask 降级相对 .container(高>>视口),flex 居中把
弹窗放到 .container 中心(视口外),真机看不到(模拟器宽松所以正常)。

- records: 日历详情弹窗移出 .container.page-enter,fixed 相对视口;
  加 style themeStyle 拿暗黑变量
- app.wxss: pageIn keyframes 去掉 transform 只留 opacity 淡入,根治所有
  页面(settings 计划编辑器/timer 完成弹窗)的 fixed 降级
- calendar-heatmap: onDayTap 的 find 用 Number(day) 修真机 dataset
  字符串化导致 === 失败;移除诊断日志

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 14:41:34 +08:00
lc 7784ccafa8 fix(ui): 修复训练记录详情弹窗被底部遮挡
pageIn 动画终态 transform: translateY(0) 是非 none 的 transform,会让
.container 成为包含块,后代 position: fixed 降级相对 .container。
记录页内容超一屏时 flex 居中把弹窗放到 .container 几何中心(视口下方),
被底部 dock 遮挡。改终态为 transform: none(视觉无变化,不创建包含块),
fixed 恢复相对视口。records 日历详情/settings 计划编辑器/timer 完成弹窗均受益。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 11:04:37 +08:00
lc 6fffc5aece fix: 振动定时器清理、完成保存守卫、暗黑冷启动、头像云存储
- timer: 振动 setTimeout 入栈追踪,暂停/停止/卸载/重练统一清理,
  避免页面销毁后残留震动(_clearVibrateTimers)
- timer: _saving 守卫统一到 _saveAndShowCompletion,自然完成与手动
  结束两路径都防重复保存;修复 onTrainAgain 不重置会话状态导致
  再练一次后第二次无语音/振动且保存被挡
- app.wxss: @media dark 补全 --text/--card-bg/--bg-soft/--border/
  --success/--danger,冷启动即为完整深色,不再背景深卡片白的割裂闪烁
- settings: 头像优先上传云存储存 fileID,三级回退(fileID->base64->
  临时URL),pushAll 不再每次传输图片字节

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 09:17:27 +08:00
lc 4268735053 fix: 深色模式下页面底色不正确
根因: 渐变背景放在 page 元素,渐变变量定义在 page 选择器,
用户手动选深色时 themeStyle 只更新容器 <view> 上的变量,
page 上的渐变变量不变(CSS 变量只能向下继承)。

修复: 渐变移到 .container::before (position: fixed 覆盖视口),
themeStyle 加 --bg-gradient-start/--bg-gradient-end 变量。
2026-07-08 11:49:21 +08:00
lc 0bba403b00 feat: 页面级入场动画 (fade + translateY) 应用到 5 个页面 2026-07-08 11:33:29 +08:00
lc 05746d8011 feat: 渐变背景 + 渐变变量 (深色 media query 覆盖) 2026-07-08 11:33:18 +08:00
lc c43f1d7389 feat: 深色模式基础设施 (system theme + 跟随系统) 2026-07-08 11:33:09 +08:00
lc 1d55df72b3 feat: v1.5 — plan editor, voice prompts, UI polish
Major features:
- Training plan editor: edit preset days/duration per plan (in-place
  override via custom_plans storage; preset ids preserved so existing
  records stay valid)
- Voice prompts at 4 fixed points during training (halfway / 30s /
  10s / done) via Tencent Cloud TTS (cloudfunctions/tts + utils/voice.js)
- Free-training button: switched from outline (transparent) to ghost
  variant (theme-tinted) for visual weight

Bug fixes:
- 4 functional pages: SVG data URIs failed to render in WeChat because
  '\#' in colors was parsed as a data-URI fragment delimiter. encode the
  whole SVG via encodeURIComponent in utils/icons.js build().
- Old records (saved before id field was added) could not be deleted
  (data-id was empty, triggered defensive guard). Backfill stable
  legacy-<month>-<index>-<duration> ids in getRecords() and persist.
- settings.js plan-row editor button event was bubbling up to the row's
  bindtap (which also fired onSelectPlan). Wrapped in catch:tap.

UI:
- Settings page: 3 hardcoded plans replaced with dynamic buildPlansList
  that overlays custom_plans on top of presets
- Plan editor: bottom-sheet modal in settings page (regular view, not
  ui-modal — WeChat custom component root element drops position:fixed
  in this runtime)
- Free-training button: rounded pill style, full-width, 24rpx gap from
  primary action; bottom sheet uses max-height: 88vh + internal scroll
- Version bumped to v1.5, last updated 2026-06-10

Removed:
- Daily reminder section (dailyReminder / reminderTime) — replaced by
  the 4 voice prompts which cover the same user need without requiring
  long-term scheduling that WeChat mini-programs can't actually do

Misc:
- utils/plan.js refactored to formula-driven: presets declare
  totalDays/startTarget/increment/cycleDays, days[] is generated. Same
  formula applies to custom plans.
- Timer _remind() guards each prompt on minimum duration so short
  free-mode sessions don't fire 'last30' at the start
- Cloud storage cloud_plans field added to data push payload; restored
  on first install via _restoreFromCloud
- .gitignore added for local AI tool caches (.reasonix/, reasonix.toml,
  .codegraph/daemon.pid)
2026-06-10 17:23:13 +08:00
lc fb3bc6c045 fix: CSS custom properties not resolving from inline style
Root cause: WXSS compiler resolves var(--primary) at compile time
against page{} declarations in app.wxss. The orange defaults
(--primary:#FF6B35 etc.) were being baked into compiled WXSS,
so the inline style theme override on .container was ignored.
Records and settings pages always rendered orange regardless of
the user's theme choice.

Fix:
1. Remove --primary, --primary-light, --primary-bg, --primary-rgb
   from page{} in app.wxss, forcing WXSS to resolve var() at
   runtime from inline style on .container
2. Expand BASE_VARS in theme.js to include default orange theme
   vars, so the initial render (before onLoad) still has valid
   CSS custom properties — no flash of unstyled content
3. Export BASE_VARS from theme.js
4. Change all 4 pages + custom-tab-bar initial data.themeStyle
   from '' to themeMod.BASE_VARS, eliminating the empty-string
   gap between first render and onLoad
2026-06-04 17:03:09 +08:00
lc 89d93c8155 refactor(ui): 12-point UI polish and bugfixes
Bug fixes:
- #1 Remove duplicate month label from calendar-heatmap (shown twice in records)
- #2 Extract shared .modal-overlay to app.wxss (was duplicated in index/records)

UX improvements:
- #3 Add long-press hint to history list in records page
- #4 Add drag handle + catchtouchmove to picker modal
- #5 Extend timer auto-navigate-back from 1.5s to 3s
- #6 Add clear data option in settings with confirmation dialog

Visual/code polish:
- #7 Remove 4 unused @keyframes (shimmer, spin) and 5 unused .icon classes
- #8 Tab bar inactive colors: hardcoded #888/#666 -> var(--text-secondary)
- #10 Split progress-ring observer to avoid redundant setData on size/color changes
- #12 Remove meaningless Math.min(planDay, 99) cap
2026-06-04 16:34:22 +08:00
lc ff2700c067 backup: snapshot before optimization 2026-06-04 16:25:43 +08:00