Skip to content

feat: Windows 系统托盘图标 — 关闭窗口后台运行 - #1

Merged
AzarAI-TOP merged 3 commits into
mainfrom
feat/windows-tray-icon
Aug 7, 2026
Merged

feat: Windows 系统托盘图标 — 关闭窗口后台运行#1
AzarAI-TOP merged 3 commits into
mainfrom
feat/windows-tray-icon

Conversation

@AzarAI-TOP

@AzarAI-TOP AzarAI-TOP commented Aug 7, 2026

Copy link
Copy Markdown
Owner

功能

在 Windows 桌面端添加系统托盘图标,关闭窗口时应用隐藏到托盘后台运行,而不是退出。

更新 (v2)

移动端 UX 改进

  • 习惯编辑:自定义量词输入 + 保存用户常用量词
  • 习惯卡片:次数前加「每日」前缀
  • 待办卡片:去掉圆圈图标,直接点击卡片切换完成
  • 待办编辑:添加 15min 选项,修复 chip 间距
  • 「明天继续」语义改为:今天完成后明天自动重建未完成副本
  • 计时器:停止按钮现在标记待办完成(显示删除线)
  • 已完成待办排到未完成后面
  • 添加健身打卡(起床/健身/睡觉)
  • 添加语言切换(中文/English)热加载
  • 添加主题模式选择(浅色/深色/跟随系统)
  • 添加删除所有数据功能
  • 开源许可合并进「关于」
  • 移除本地 Go 后端依赖(全部走 Supabase)
  • 新建按钮改为居中 TODO/Habit 选择界面

Windows 端

  • 重新生成托盘图标(优化小尺寸可见度)
  • 添加霞鹜文楷字体提升 USTC 要闻阅读体验

核心架构

  • 添加 AppLocaleProvider 实现 i18n 热切换
  • 数据库 v2:添加 workout_time 列 + 迁移
  • deleteAllData() 方法
  • 移除 apiBaseUrl/apiConnected

- Fix version number inconsistency (0.1.0 → 1.0.0 in About)
- Make ID badge dynamic based on user name
- Fix 10 redundant null checks in sync_service realtime callbacks
- Migrate deprecated anonKey → publishableKey (Supabase API)
- Add __pycache__/ and *.pyc to .gitignore
- Clean up unused imports in today_screen.dart
- Add Supabase cloud support for USTC news (3-tier fallback)
- Add upload_ustc_news.py script for cron job cloud sync
- Fix prefer_final_fields and dangling_library_doc_comments warnings
- flutter analyze: 18 issues → 4 (0 errors)
- Add tray_manager package for system tray support
- Create TrayService with tray icon, tooltip, and context menu
  - Left-click tray icon: show/restore main window
  - Right-click: context menu (show / quit)
- Intercept window close: hide to tray instead of quitting
  - windowManager.setPreventClose(true) + WindowListener.onWindowClose
- Add custom app icon (tomato orange + checkmark) as .ico and .png
- App stays running in background after closing window
- User can quit from tray menu
Mobile UX:
- Habit edit: custom unit input + saved user units (SharedPreferences)
- Habit card: add "每日" prefix before count
- Todo card: remove circle icon (tap card to toggle)
- Todo edit: add 15min option, fix chip spacing
- "明天继续" semantics: completing today auto-recreates for tomorrow
- Timer: stop button now marks todo complete (strikethrough)
- Completed todos sorted after incomplete ones
- Add workout check-in alongside wake/sleep
- Add language switcher (中文/English) with hot reload
- Add theme mode selector (light/dark/system)
- Add delete all data option in settings
- Merge open source licenses into About
- Remove Go backend dependency (Supabase only)
- Centered TODO/Habit selection overlay on add

Windows:
- Regenerate tray icon with better small-size visibility
- Add LXGW WenKai font for USTC news readability

Core:
- Add AppLocaleProvider for i18n hot-switch
- Database v2: add workout_time column + migration
- deleteAllData() in database and provider
- Remove apiBaseUrl/apiConnected from provider
@AzarAI-TOP
AzarAI-TOP merged commit 66317c6 into main Aug 7, 2026
1 check failed
@AzarAI-TOP

Copy link
Copy Markdown
Owner Author

直接合并到 main,不再通过 PR

AzarAI-TOP pushed a commit that referenced this pull request Aug 7, 2026
#1 (P0): Timer completion skipped keepTomorrow copy creation —
  timer_screen called updateTodo instead of toggleTodoComplete.
  Fix: new completeTodoWithDuration() method in AppProvider that
  handles keepTomorrow copy + stale/deleted todo guard.

#2 (P0): Repeated toggle taps created ghost keepTomorrow copies.
  Fix: idempotent check — only create copy if no incomplete duplicate
  with same title already exists in _todos.

#3 (P0): SleepRecord upsert never matched same-date records because
  conflict was on UUID id, not record_date.
  Fix: query existing record by record_date first; update in-place
  preserving original id, or insert if none exists.

#4 (P1): reorderTodos double index adjustment caused wrong positions.
  Fix: _onReorder maps display indices to provider.todos indices
  via incompleteTodos list, eliminating index-space mismatch.

#5 (P1): Timer _recordSessionAndComplete used stale widget.todo snapshot.
  Fix: completeTodoWithDuration reads current state from provider.todos;
  silently skips if todo was deleted (focus session still recorded).

#6 (P2): Countdown cleanup used local time, causing premature deletion
  when crossing timezones.
  Fix: use DateTime.now().toUtc() for comparison.
@AzarAI-TOP
AzarAI-TOP deleted the feat/windows-tray-icon branch August 8, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant