Skip to content

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

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

feat(ui): 增加概览页年度活动热图#716
FFFxueGawaine wants to merge 2 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 凭据持久化、Tauri / Rust 逻辑、数据库结构、IPC API 变更。
  • 对现有用户 / 本地环境 / 构建流程的影响:纯前端 UI / mock 数据 / i18n 文案调整;生产历史数据读取仍沿用现有 listHistory,构建流程不变。

截图

浅色主题

浅色年度活动热图

深色主题

深色年度活动热图

每周 / 累计

每周模式

累计模式

测试计划

  • 命令:npm run build
  • 结果:通过;仍会输出已有的 IPC circular chunk warning,涉及 getSettings / setSettings 的分块循环,不是本 PR 引入。
  • 命令:npm run dev -- --host 127.0.0.1 --port 5173
  • 结果:本地概览页可打开;浅色 / 深色下年度活动热图显示正常;每日 / 每周 / 累计切换可用;每周 / 累计按周一为周起点。
  • 证据路径:
    • 本地预览:http://127.0.0.1:5173/
    • 截图目录:docs/images/pr-716/
    • 当前提交:2cb22ce2621febbbf752e834c18d26964c07458c

PR Type

Enhancement, Documentation


Description

  • Add annual activity heatmap with daily/weekly/cumulative views

  • Introduce theme toggle button on overview page

  • Update mock data for realistic history distribution

  • Add full i18n support for heatmap and theme toggle


Diagram Walkthrough

flowchart LR
  Overview["Overview Page"]
  Metrics["Metrics Cards"]
  WeekChart["Week Chart<br/>(Last 7 days)"]
  RecentTranscripts["Recent Transcripts"]
  ActivityHeatmap["Annual Activity Heatmap"]
  ThemeToggle["Theme Toggle Button"]
  Overview --> Metrics
  Overview --> WeekChart
  Overview --> RecentTranscripts
  Overview --> ActivityHeatmap
  Overview --> ThemeToggle
  ActivityHeatmap --> DailyView["Daily"]
  ActivityHeatmap --> WeeklyView["Weekly"]
  ActivityHeatmap --> CumulativeView["Cumulative"]
Loading

File Walkthrough

Relevant files
Enhancement
2 files
Icon.tsx
Add sun and moon icons for theme toggle                                   
+2/-0     
Overview.tsx
Implement annual activity heatmap, theme toggle, and improve week
chart
+730/-31
Documentation
5 files
en.ts
Add English i18n strings for activity heatmap and theme toggle
+18/-1   
ja.ts
Add Japanese i18n strings for activity heatmap and theme toggle
+18/-1   
ko.ts
Add Korean i18n strings for activity heatmap and theme toggle
+18/-1   
zh-CN.ts
Add Chinese Simplified i18n strings for activity heatmap and theme
toggle
+18/-1   
zh-TW.ts
Add Chinese Traditional i18n strings for activity heatmap and theme
toggle
+18/-1   
Tests
1 files
mock-data.ts
Update mock history to distribute across days for realistic testing
+34/-17 
Formatting
1 files
global.css
Add CSS animation keyframe for heatmap cells                         
+5/-0     

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 2cb22ce)

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

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.

1 participant