DayLens:把"今天做了什么"翻译成人话DayLens: Translating "What Did I Do Today" Into Human Language
每天晚上,我都会想:今天到底干了什么?时间花在哪了?写代码用了几小时?刷手机又用了几小时?凭感觉估,永远不准。Every evening, I wonder: what did I actually do today?Where did the time go? How many hours coding? How many scrolling my phone? Guessing by feel is never accurate.
DayLens:把"今天做了什么"翻译成人话
为什么做 / 最初想法 / 技术选择
为什么做
每天晚上,我都会想:今天到底干了什么?
时间花在哪了?写代码用了几小时?刷手机又用了几小时?凭感觉估,永远不准。
市面上有 RescueTime 这种工具,但数据要上传到别人的服务器。我不喜欢。
最初想法
DayLens 的核心想法:本地优先的时间追踪。
- 记录窗口标题、进程名、活跃时长
- 数据只存本地 SQLite,不上传
- 每天生成一份"今日复盘":时间都去哪了
技术选择
Python + PySide6:桌面 GUI,Python 生态做数据分析顺手。
本地 SQLite:单文件数据库,静止数据库可以复制,运行时应使用一致性备份。本地存储保存在本机;启用远程 AI 时,发送的摘要会离开本机。
AI 总结(可选):把一天的活动记录喂给 AI,生成自然语言总结。"上午写了 3 小时代码,下午开了 2 小时会,晚上刷了 1 小时 B 站"——比干巴巴的饼图好读。
踩过的坑
坑 1:窗口标题抓不到
Windows 上有些应用(特别是 Electron 应用)的窗口标题是动态的,切个标签页就变了。解法:按进程聚合,而不是按窗口标题。
坑 2:空闲判断
人走开了,电脑开着,算工作时间吗?加了空闲检测:5 分钟无键鼠,标记为空闲,不计入。
坑 3:数据膨胀
每秒记录一次,一天就是 86400 条。一周下来数据库就上百 MB。改成:活动变化时才记录 + 每小时聚合一次。
现在的状态
基本可用,MIT 开源。每天睡前看一眼复盘,挺有满足感的。
根据项目记录整理。部分细节待补充。
DayLens: Translating "What Did I Do Today" Into Human Language
Why I built it / The original idea / Tech choices
Why I Built It
Every evening, I wonder: what did I actually do today?
Where did the time go? How many hours coding? How many scrolling my phone? Guessing by feel is never accurate.
RescueTime exists, but data goes to someone else's server. I don't like that.
The Original Idea
DayLens's core idea: local-first time tracking.
- Record window titles, process names, active duration
- Data stays in local SQLite, nothing uploaded
- Daily "today in review": where did the time go
Tech Choices
Python + PySide6: desktop GUI, Python's ecosystem is handy for data analysis.
Local SQLite: single-file database, a stopped database can be copied, while a running one needs a consistent backup. Local storage stays on the device; data sent to an enabled remote AI service leaves it.
AI summary (optional): feed a day's activity to AI, get a natural-language summary. "3 hours coding in the morning, 2 hours of meetings in the afternoon, 1 hour of Bilibili at night" — more readable than a dry pie chart.
Pitfalls
Pitfall 1: Can't抓 window titles
Some apps on Windows (especially Electron ones) have dynamic window titles — switch a tab and it changes. Fix: aggregate by process, not by window title.
Pitfall 2: Idle detection
You walk away, computer stays on — does that count as work? Added idle detection: 5 minutes without keyboard/mouse marks idle, excluded.
Pitfall 3: Data bloat
Recording every second = 86,400 rows a day. A week hits hundreds of MB. Changed to: record only on activity change + hourly aggregation.
Where It Stands
Basically usable, MIT licensed. Checking the daily review before bed is oddly satisfying.
Compiled from project records. Some details to be filled in.