Skip to content

feat(ui): 增加概览页年度活动热图#716

Open
FFFxueGawaine wants to merge 3 commits into
Open-Less:betafrom
FFFxueGawaine:feat/overview-activity-heatmap
Open

feat(ui): 增加概览页年度活动热图#716
FFFxueGawaine wants to merge 3 commits into
Open-Less:betafrom
FFFxueGawaine:feat/overview-activity-heatmap

Conversation

@FFFxueGawaine

@FFFxueGawaine FFFxueGawaine commented Jun 19, 2026

Copy link
Copy Markdown

User description

摘要

Fixes #。(暂无关联 issue)

说明这个 PR 解决的单一目标:在「今日概况」概览页增加可关闭的年度活动热图 UI,让用户能用每日 / 每周 / 累计三种视图查看过去一年的 Token / 历史记录活跃度。

修复 / 新增 / 改进

  • 新增概览页年度活动热图,支持「每日 / 每周 / 累计」三种视图。
  • 每日、每周、累计都沿用格子化视觉;每周和累计按周离散成 7 个等级展示。
  • 每周 / 累计统计以周一到周日为一周,悬浮提示显示该周的周一日期。
  • 在「设置 → 通用 → 外观」新增「显示概况活动热图」开关,默认开启。
  • 关闭开关只隐藏概况页年度活动热图,不删除历史记录,也不影响其它概况指标。
  • 移除概况页顶部的一键浅色 / 深色切换入口,主题切换仍保留在外观设置里。
  • 悬浮提示跟随鼠标 / 格子位置显示对应日期、周起始日或累计数据。
  • 切换视图时增加从左到右的快速出现动画。
  • 优化 mock history 分布,让本地开发环境能看到近 7 天柱状图和年度热图效果。
  • 补充 zh-CN / zh-TW / en / ja / ko 文案。

兼容

  • 不包含:后端历史保留策略(包括把历史记录 200 条上限改为无上限)、Provider 凭据持久化、数据库结构、历史数据迁移、新增 IPC 命令。
  • 对现有用户 / 本地环境 / 构建流程的影响:新增一个默认开启的外观偏好 showOverviewActivityHeatmap;生产历史数据读取仍沿用现有 listHistory,构建流程不变。

截图

浅色主题

浅色年度活动热图

深色主题

深色年度活动热图

每周 / 累计

每周模式

累计模式

测试计划

  • 命令:npm run build
  • 结果:通过;仍会输出已有的 IPC circular chunk warning,涉及 getSettings / setSettings 的分块循环,不是本 PR 引入。
  • 命令:cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml
  • 结果:通过;仍会输出既有未使用代码 warning,不是本 PR 引入。
  • 命令:npm run dev -- --host 127.0.0.1 --port 5173
  • 结果:本地概览页可打开;每日 / 每周 / 累计切换可用;每周 / 累计按周一为周起点;外观设置开关可隐藏概况页年度热图。
  • 证据路径:
    • 本地预览:http://127.0.0.1:5173/
    • 截图目录:docs/images/pr-716/
    • 当前提交:141de633d9d3f6ad17a4bc379be7c7dbab772174

PR Type

Enhancement


Description

  • Add annual activity heatmap to Overview page

  • Support daily, weekly, and cumulative views

  • Add toggle in Settings → Appearance

  • Update i18n for zh-CN, zh-TW, en, ja, ko

  • Improve WeekChart layout and mock data distribution


Diagram Walkthrough

flowchart LR
  A["Overview page with metrics"] --> B["Annual Activity Heatmap"]
  B --> C["Daily view (grid of squares)"]
  B --> D["Weekly view (stacked cells)"]
  B --> E["Cumulative view (running total)"]
  B --> F["Settings toggle"]
  F --> G["Show/hide heatmap"]
Loading

File Walkthrough

Relevant files
Configuration changes
2 files
types.rs
Add show_overview_activity_heatmap preference field           
+8/-0     
types.ts
Add showOverviewActivityHeatmap to UserPreferences             
+2/-0     
Documentation
5 files
en.ts
Add English heatmap and setting strings                                   
+19/-1   
ja.ts
Add Japanese heatmap and setting strings                                 
+19/-1   
ko.ts
Add Korean heatmap and setting strings                                     
+19/-1   
zh-CN.ts
Add Chinese (Simplified) heatmap and setting strings         
+19/-1   
zh-TW.ts
Add Chinese (Traditional) heatmap and setting strings       
+19/-1   
Tests
2 files
mock-data.ts
Improve mock history distribution for heatmap demo             
+35/-17 
stylePrefs.test.ts
Add showOverviewActivityHeatmap to test data                         
+1/-0     
Enhancement
3 files
Overview.tsx
Implement ActivityHeatmapCard with three views                     
+668/-29
ThemeSection.tsx
Add toggle for overview activity heatmap                                 
+14/-1   
global.css
Add keyframe for heatmap cell animation                                   
+5/-0     

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 1fed45a)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 15f4adf

@FFFxueGawaine

Copy link
Copy Markdown
Author

UI 截图证据

这些截图已随本 PR 提交到 docs/images/pr-716/,不是本地路径。

浅色主题

浅色年度活动热图

深色主题

深色年度活动热图

每周 / 累计 / 悬浮提示

每周模式

累计模式

悬浮提示

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 55037ed

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 2cb22ce

@H-Chris233

Copy link
Copy Markdown
Collaborator

我们决定合并你的pr,但在此之前请给开关用于开关该功能

jiangmuran
jiangmuran previously approved these changes Jun 21, 2026

@jiangmuran jiangmuran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常好代码,使我免于阅读AI Slop之苦

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 141de63

@FFFxueGawaine

FFFxueGawaine commented Jun 21, 2026

Copy link
Copy Markdown
Author

@jiangmuran 谢谢!确实有 GPT-5 帮忙,但我尽量把 diff 控制得小一点、方便 review。

维护者要求的「显示概况活动热图」开关和设置页截图也已经补上了;方便的话麻烦再帮忙 review 一下。来自Codex的回复。

@FFFxueGawaine

Copy link
Copy Markdown
Author

Added the Settings toggle screenshot as well:

Settings toggle

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 1fed45a

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 4588a23

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 1fed45a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants