admin
77e05998a5
docs(maintenance): 合并日常排障文档
2026-09-14 15:59:57 +08:00
admin
df4c3f86f0
docs(maintenance): 记录端口与证书排障
2026-09-14 15:59:27 +08:00
admin
d3ed683652
fix(api): 合并接口兼容热修复
2026-09-14 15:41:59 +08:00
admin
30ee66cef5
fix(api): 兼容部署过渡期接口路径
2026-09-14 15:41:09 +08:00
admin
5cf98c0c23
refactor(api): 合并接口命名清理
2026-09-14 15:36:33 +08:00
admin
dcf4cb0719
refactor(api): 去除代码版本命名
2026-09-14 15:35:53 +08:00
admin
bbc4bdd140
ci(deploy): 添加 dev 自动部署脚本
2026-09-12 17:24:36 +08:00
admin
e5d1b7fa42
merge: 合并阅读目标持久化与紧凑布局
2026-09-12 17:17:15 +08:00
admin
094e1aca3d
feat(reading-goals): 持久化阅读目标并收紧看板布局
2026-09-12 17:16:40 +08:00
admin
61d3951905
feat(discovery): 完善书籍搜索推荐与日志记录
2026-09-12 08:39:02 +08:00
admin
aee8c58b04
chore(config): 切换项目数据源到远程 MySQL
2026-09-12 08:39:02 +08:00
admin
d33601c987
fix(discovery): 修复真实书籍封面显示
2026-09-12 08:38:58 +08:00
admin
db8d5fc391
fix(server): 修复启动脚本端口检测与打印
2026-09-12 08:38:30 +08:00
admin
a1f54e765e
Merge remote-tracking branch 'origin/master' into dev
...
# Conflicts:
# .gitignore
# app.py
# static/js/app.js
2026-09-11 18:25:03 +08:00
admin
8d2f8f521f
Merge branch 'codex/weread-dashboard-design' into dev
2026-09-11 18:22:33 +08:00
admin
87367e237a
Merge branch 'feat/v2-real-data' into dev
...
v2 看板前端接入真实微信读书数据接口。
包含:
- feat(api): 新增 /api/v2/* 数据接口层(独立 Blueprint,v1 接口零改动)
- feat(web): 前端样式完全沿用 2.0 设计稿,仅替换数据来源为真实接口
- chore(legacy): 归档 v1 前端至 legacy/v1
- chore: 新增 start_dashboard.sh 启动脚本
- docs: 补充 V2 接口文档与验证截图
2026-09-11 18:21:20 +08:00
admin
d917936049
docs: 补充 v2 接口文档与验证截图,更新 README
...
- docs/V2_API.md 说明 /api/v2/* 各接口参数与回包结构
- docs/screenshots/ 归档概览/书架/笔记/详情/发现/暗色主题验证截图
- README 说明 v2 为默认前端、启动方式与 v1 归档位置
2026-09-11 18:21:13 +08:00
admin
4cbaabd42c
chore: 新增 v2 看板启动脚本 start_dashboard.sh
...
封装启动流程,支持 PORT / WEREAD_API_KEY / PYTHON_BIN 环境变量。
默认使用托管 Python 环境,避免系统解释器缺少 flask 依赖。
2026-09-11 18:21:13 +08:00
admin
25293a1d50
chore(legacy): 归档 v1 前端至 legacy/v1
...
v2 成为默认前端后,把 v1 的模板与静态资源原样归档保留,
便于对照回滚。v1 后端接口 /api/* 未做改动。
2026-09-11 18:21:13 +08:00
admin
8af75454a4
feat(web): v2 看板前端接入真实数据接口
...
前端样式完全沿用 2.0 设计稿,仅替换数据来源。
- templates/index.html 改用设计稿 DOM 结构与类名,引用 styles.css + weapi.js + app.js
- static/css/styles.css 引入 2.0 设计稿样式
- static/js/weapi.js 新增,封装 /api/v2/* 调用为全局 WeApi
- static/js/app.js 重写:保留设计稿全部渲染函数与 CSS 类名,
数据源由 demo-data.js 静态假数据改为真实接口,
补充异步加载器、加载/错误状态机与重试按钮
- static/js/demo-data.js 保留为设计稿原始假数据对照
2026-09-11 18:21:06 +08:00
admin
a114f3f407
feat(api): 新增微信读书 v2 数据接口层
...
新建 api_v2.py,以独立 Flask Blueprint 挂载 /api/v2/*,与既有 /api/* 完全隔离,不影响 v1 接口。
- 提供 status / dashboard / shelf / notebooks / notes / book / reviews /
highlights / underline-thoughts / thought / archives / recommend / search 等接口
- 进程内 TTL 缓存降低接口调用频次;MySQL 不可用时返回 degraded 降级标记
- 阅读状态按 finish_reading / progress / 近 30 天阅读记录综合判定
- 周月维度缺少偏好画像时回退 overall 口径补齐,并标注 preference_source
- app.py 注册 Blueprint;__main__ 端口改为读取 PORT 环境变量
2026-09-11 18:21:06 +08:00
admin
e3856ccdcf
chore: 忽略 .workbuddy 工作区记忆目录
2026-09-11 18:21:06 +08:00
admin
8e8a0bfba6
feat(web): 移植 2.0 阅读看板探索 Demo
2026-09-11 17:30:10 +08:00
admin
f42b114384
docs: 补充 1.0 刷新按钮排查记录
2026-09-11 17:13:25 +08:00
admin
92a48d14cd
feat: 添加配置读取工具,支持从环境变量和 .env 文件加载 WEREAD_API_KEY
...
fix: 修复启动脚本中的 Python 解释器路径识别
style: 更新样式以支持按钮最小宽度和灵活布局
docs: 添加项目最终文档,整合各类信息与说明
2026-07-17 22:11:27 +08:00
admin
3d5a402117
fix(button): 解决按钮高度抖动问题
...
- 分析发现字符 ↻ 在某些字体下被当作大尺寸字符导致换行
- 修复方案将按钮拆分为图标和文字两层结构
- 使用 inline-flex 布局配合固定高度防止高度变化
- 替换不稳定字符 ↻ 为更稳定的 ⟳ (U+27F3)
- 添加 flex-shrink:0 防止被父容器压缩
- 通过独立选择器控制文字更新保留图标结构
2026-07-17 15:30:48 +08:00
admin
5608562f02
feat: 添加 weread 启停命令 & 修复 macOS SSL 证书问题
...
- 新增 weread CLI 脚本,支持 weread start/stop [port] 一键管理服务
- app.py 端口改为从环境变量 WEREAD_PORT 读取,默认 8080
- 修复 macOS Python urllib 调用微信读书 API 时 SSL 证书验证失败问题(引入 certifi)
2026-07-17 14:34:35 +08:00
admin
c3f5c0ff03
刷新按钮改用 span 结构 + flex 布局,彻底修复高度抖动\n\n问题:\n- width:120px + 字符 ↻ 在某些字体下被当成大尺寸字符渲染\n- 文字强制换行成两行,按钮高度暴涨到 150px+ 变成竖长方形\n\n修复:\n- 改用 ⟳ (U+27F3) 字符,更稳定\n- HTML 结构:<span class="btn-icon">⟳</span><span class="btn-text">刷新</span>\n- CSS 改用 display:inline-flex + align-items:center + justify-content:center\n- 固定 height:36px + padding:0 16px\n- JS 通过 .btn-text 选择器单独更新文字,保留图标 span
2026-07-17 13:28:08 +08:00
admin
baeda63646
修复刷新按钮宽度抖动:改用固定 width:120px
...
- min-width 改为固定 width:120px,容纳最长文案'↻ 同步中...'
- transition 从 all 改为仅 color/border/opacity,避免宽度动画
- 添加 box-sizing:border-box 确保 padding 不撑大按钮
2026-07-17 13:24:13 +08:00
admin
7bc02075bd
刷新按钮支持数据同步:调用 /api/sync 拉取最新数据
...
- app.py 新增 /api/sync POST 接口:运行 fetch_data.py + migrate_to_mysql.py
- refreshShelf() 先调用 /api/sync 同步数据,再重新加载书架
- 按钮文案三阶段:同步中... → 加载中... → 刷新
- CSS 增加 min-width 防止按钮宽度抖动
- launchd plist 和 start_server.sh 均配置 WEREAD_API_KEY 环境变量
2026-07-17 13:22:19 +08:00
admin
e8552a9a4c
gitignore: 忽略 .server.pid
2026-07-17 13:15:00 +08:00
admin
8333230f77
添加书架刷新按钮 + 后端服务保活方案
...
前端:
- 书架筛选栏新增「↻ 刷新」按钮,点击重新加载分类和书架数据
- 新增 refreshShelf() 函数,带 loading 状态反馈
- 新增 .shelf-refresh-btn CSS 样式
后端保活:
- 新增 start_server.sh 启动脚本 (start/daemon/stop/restart/status)
- 新增 com.weread-dashboard.plist launchd 服务配置
- KeepAlive=true: 崩溃自动重启
- RunAtLoad=true: 开机自动启动
- 日志输出到 /tmp/weread_server.log
2026-07-17 13:14:55 +08:00
admin
7d983e38da
书架恢复横向网格展示,移除分类分组标题
...
- loadShelf 始终用简单网格渲染,不再调用 renderBooksGroupedByCategory
- 删除 renderBooksGroupedByCategory 函数
- 清理 .shelf-group-header / .shelf-group-count CSS 样式
- 后端 sort=category 仍生效(按分类排序),前端不显示分组标题
- 分类筛选标签保留
2026-07-17 12:33:04 +08:00
admin
8b24052ab6
移除分类排序按钮,默认按分类排序展示
...
- 删除 index.html 中的 shelfSortBtn 按钮
- shelfSortMode 默认改为 category,始终按分类排序
- 删除 toggleShelfSort 函数和 .shelf-sort-btn CSS 样式
- 书架列表默认以分类分组渲染
2026-07-17 12:29:01 +08:00
admin
e578a90543
feat: collapsible hierarchical category tags + category sort for shelf
...
- Backend: add parent_category param (matches '历史-*' sub-categories),
sort=category mode (ORDER BY category ASC), return category_tree with
parent→sub→count hierarchy
- Frontend: replace flat 63-tag list with collapsible parent tags showing
book counts, click parent to expand sub-category pills with fade-in
animation, click sub to filter to exact category
- Add '分类排序' toggle button: when active, books are grouped by
category with colored section headers showing category name + count
- Clicking same parent again collapses it; '全部' resets everything
- Mobile responsive: smaller tag sizes, reduced indent on narrow screens
2026-07-17 12:21:36 +08:00
admin
ec88707e6b
fix: close thoughts page and modal when switching nav tabs
...
switchTab() now checks if the thoughts detail page or book detail modal
is open and closes them before switching to the target tab. Previously,
when on the thoughts page, clicking any nav tab (charts, ranking, etc.)
would silently fail because mainView was still hidden.
2026-07-17 12:17:10 +08:00
admin
90b9614b5e
feat: add search and sort to thoughts detail page
...
- Search box: real-time filter across highlights, book reviews, and
thoughts content (mark_text, content, abstract fields)
- Sort dropdown: 3 modes - newest first, oldest first, by chapter order
(chapter_uid + range position)
- Chapter sort mode groups highlights by chapter with titles
- Time sort mode flattens highlights with chapter labels
- Empty state shows search keyword when no results match
- Mobile responsive: toolbar stacks vertically on narrow screens
2026-07-17 12:16:19 +08:00
admin
d276608538
fix: replace weread:// deep link with web URL for 'Open in WeRead' button
...
The hardcoded 'weread://reading?bId=...' scheme only works on mobile
devices with the WeRead app installed. On desktop browsers, clicking
the button did nothing. Now uses data.deep_link from the API response
(https://weread.qq.com/ ...) with fallback logic: try weread:// scheme
via hidden iframe for 1.5s, then fall back to opening the web URL.
2026-07-17 12:14:12 +08:00
admin
4c916eceb7
feat: add global search bar, fix search cover blur, shelf title search + category tags
...
1. Fix hdCover() to also replace s_ prefix (search results use s_ not t6_)
2. Add persistent search bar below navbar, switches to discover tab on search
3. Shelf search now supports book title and author search (new keyword param)
4. Add category tag pills above book grid, click to filter by category
5. Update /api/shelf backend: keyword param for title/author, category for exact match
6. Mobile responsive styles for search bar and category tags
2026-07-17 12:12:23 +08:00
admin
7c918140b3
feat: add thoughts detail page, tab navigation, vertical ranking, back-to-top
...
1. Thoughts detail page: standalone full-page view replacing modal,
classifies content into 3 categories (highlights/book reviews/thoughts)
with filter tabs, visual badges, and chapter grouping
2. Tab navigation: sections converted from vertical scroll to horizontal
tab switching with lazy-loaded charts
3. Reading ranking: changed from card grid to vertical list with smaller
covers matching shelf size, gold/silver/bronze rank badges
4. Back-to-top button: floating button appears after scrolling 400px
5. Book detail modal: added 'View Thoughts' button to navigate to
thoughts page
2026-07-17 11:30:24 +08:00
admin
4d8cc2a2d7
fix: clamp review star value to 0-5 range to prevent repeat() RangeError
...
WeRead API returns star=100 for book reviews and star=-1 for thoughts,
causing '☆'.repeat(5-100) to throw 'Invalid count value: -95'.
2026-07-17 11:17:55 +08:00
admin
ae40ed93d6
feat: add dark/light theme toggle, fix cover display, refine overall style
...
- Add theme toggle button in navbar with sun/moon icons
- Define [data-theme=dark] CSS variables (warm dark palette)
- Persist theme preference in localStorage
- Follow system prefers-color-scheme on first visit
- Anti-flash inline script sets theme before render
- ECharts charts re-render with theme-aware colors on toggle
- Fix reading ranking covers: aspect-ratio 3/4 instead of fixed height
- Fix discover covers: aspect-ratio 3/4 for proper portrait display
- Replace purple hero gradient with warm brown/amber matching accent
- All hardcoded colors replaced with CSS variables
- Smooth 0.3s transitions on all theme-dependent elements
- Update footer text from SQLite to MySQL
2026-07-17 11:13:11 +08:00
admin
9c32f69f71
merge: data model v2.0 - 31 tables, complete API coverage, dual-column timestamps, audit columns, updated docs
2026-07-17 10:40:38 +08:00
admin
4c1a66ea6a
docs: update technical and metadata docs for v2.0 (31 tables)
2026-07-17 10:40:33 +08:00
admin
2a809eb7cc
refactor: complete data model v2.0 based on official API docs
...
数据模型全面重构,基于微信读书官方 8 份 API 文档逐字段比对:
1. 表结构从 18 张扩展到 31 张表:
新增表:shelf_albums(有声书)、shelf_meta(书架元信息)、prefer_publishers(偏好出版社)、
prefer_cps(偏好版权方)、prefer_books(偏好书籍卡片)、read_rank(好友排行)、
medals(勋章)、year_reports(年度报告)、book_best_bookmarks(热门划线)、
book_underlines(划线热度)、similar_books(相似推荐)、public_reviews(公开点评)、
search_sessions(搜索会话)
2. 补全所有遗漏字段:
- reading_stats: +13 个字段 (baseTime, compare, readRate, wrReadTime, wrListenTime 等)
- book_chapters: +8 个字段 (wordCount, level, price, paid, isMPChapter, anchors 等)
- book_reviews: +4 个字段 (abstract, range, chapterUid, chapterIdx)
- recommended_books: +5 个字段 (deepLink, searchIdx, price, payType, type)
- search_results: +8 个字段 (deepLink, payType, price, soldout, scope 等)
- book_details: +2 个字段 (deepLink, newRatingDetail)
- prefer_categories: +2 个字段 (parentCategoryId, categoryType)
3. 时间戳双列设计:
- 所有整型时间戳字段均伴随 _dt TIMESTAMP 列 (如 read_update_time + read_update_time_dt)
- 便于直接查询和展示,无需应用层转换
4. 审计字段:
- 每张表均维护 created_at 和 updated_at
- MySQL 使用 DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
5. 索引优化:
- 主键、唯一约束、查询索引根据实际访问模式重新设计
- 新增复合索引、排序索引、全文检索索引
6. 数据采集脚本更新:
- 覆盖所有新增表和字段的数据采集
- skill_version 升级至 1.0.4
- 有声书/专辑数据采集 (shelf_albums)
- 偏好出版社/版权方/书籍卡片采集
- 勋章、年度报告数据采集
7. 后端适配:
- 移除旧版 ensure_tables 动态建表逻辑
- 所有按需 API INSERT 语句适配新表结构
- 搜索结果入库新增 search_sessions 会话表
- 推荐书籍入库新增 batch_id 批次标识
2026-07-17 10:37:07 +08:00
admin
5e4de7a336
merge: merge dev into master - MySQL switch, Chinese comments, health check, docs
2026-07-17 10:26:14 +08:00
admin
507b9c5704
feat: switch to MySQL, add Chinese comments, health check, and technical docs
...
1. 数据源切换至 MySQL:
- app.py 从 SQLite 切换到 PyMySQL,所有 API 读取 MySQL weread_dashboard 数据库
- 新增 db_required 装饰器统一管理数据库连接和异常处理
- 新增 /api/health 健康检查接口,检测 MySQL 连接状态
- MySQL 连接失败时返回 HTTP 503 和告警信息
- 修复 fetched_at 字段 Unix 时间戳到 MySQL TIMESTAMP 的兼容问题
2. 前端数据库连接告警:
- 页面加载时优先调用 /api/health 检查 MySQL 连接
- 连接失败时显示固定告警横幅,阻止后续数据加载
- CSS 告警横幅样式(黄色背景、下滑动画)
3. 代码中文注释:
- app.py:所有函数、API 接口、工具函数添加完整中文文档注释
- fetch_data.py:所有 SQLite 建表语句添加列级中文注释
- migrate_to_mysql.py:保留已有中文注释
4. 技术文档与元数据文档:
- docs/TECHNICAL_DOC.md:项目概述、系统架构、API 设计、部署指南
- docs/METADATA_DOC.md:18 张表完整字段说明、索引、表关系、数据类型规范
2026-07-17 10:26:07 +08:00
admin
292cb3f9e9
merge: merge dev into master - MySQL migration script
2026-07-17 10:16:47 +08:00
admin
72e9971a69
feat: add SQLite to MySQL migration script
...
- migrate_to_mysql.py:将 weread.db (SQLite) 全部 18 张表数据迁移至 MySQL weread_dashboard 数据库
- 支持时间戳列自动转换(SQLite int -> MySQL TIMESTAMP)
- 共迁移 862 行数据,中文内容 utf8mb4 完整保存
2026-07-17 10:16:41 +08:00
admin
463b736d13
merge: merge dev into master - book detail, notes, recommendation, MySQL schema
...
合并 dev 分支新功能到 master:
1. 书籍详情弹窗(点击书架书籍查看详情)
2. 笔记详情弹窗(点击笔记书籍查看划线和想法)
3. 推荐页面(个性化推荐 + 关键词搜索)
4. MySQL 版本建表语句
2026-07-17 10:07:11 +08:00
admin
ebfa3a1852
feat: add book detail, notes detail, recommendation page and MySQL schema
...
新增功能:
- 书籍详情弹窗:点击书架书籍展示详细信息(书名、作者、出版社、ISBN、字数、评分、简介、阅读进度),数据实时从微信读书 API 获取并入库
- 笔记详情弹窗:点击有笔记的书展示划线和想法/点评,按章节分组展示,数据实时获取并入库
- 推荐页面:个性化推荐(为你推荐)+ 关键词搜索书籍,数据从微信读书 API 获取并入库
- 修复 Flask 中文 URL 参数编码问题
后端新增 API:
- GET /api/book/detail?book_id=xxx — 书籍详情
- GET /api/book/notes?book_id=xxx — 笔记详情(划线+想法)
- GET /api/recommend?maxIdx=0 — 个性化推荐
- GET /api/search?keyword=xxx — 搜索书籍
数据库新增表:
- book_details, book_progress, book_highlights, book_chapters
- book_reviews, recommended_books, search_results
MySQL 版本建表语句 schema_mysql.sql:
- 18 张表的完整 DDL,含索引、字符集 utf8mb4、字段注释
- 适用于后续从 SQLite 迁移至 MySQL
2026-07-17 10:07:05 +08:00
admin
1e9c537b86
feat: init weread data dashboard
...
- 数据采集脚本 fetch_data.py:从微信读书 API 拉取书架、阅读统计、笔记数据存入 SQLite
- Flask 后端 app.py:提供 8 个 API 接口(总览、年度趋势、读书排行、偏好分类、偏好作者、时段分布、书架、笔记)
- 前端页面:ECharts 图表(年度趋势、时段分布、分类饼图、作者排行)、书架网格、笔记概览
- 数据规模:404 本书架、339 小时阅读、304 天阅读、1709 条笔记
2026-07-17 09:59:37 +08:00