fix(stats): 数据速览用完整星期名,脚注时间改逐行对齐

- 「提问最集中在 三 19 点前后」:洞察复用了热力图列头的短标签
  stats.wd.*(一…日 / Mon…),那是为窄列头设计的单字词条,
  进句子就成了「三」。新增 stats.weekday.1..7 完整名(周一 / Monday /
  月曜日),洞察改用该组,stats.wd.* 只留给列头;补测试断言锁住。
- 页脚入口文案「数据」→「统计数据」(四语言同步)。
- 页面脚注四条时间由「基准日 x · 计算于 y」一行改为两列网格逐行排列,
  标签统一带冒号,下面两段说明保持独立段落。
This commit is contained in:
tamakyi
2026-10-24 01:08:50 +08:00
parent a5441c99fd
commit 64436d9d61
8 changed files with 114 additions and 46 deletions
+5
View File
@@ -5,6 +5,7 @@
package stats
import (
"strings"
"testing"
"time"
@@ -104,4 +105,8 @@ func TestOverviewDerived(t *testing.T) {
require.Len(t, page.WeekdayLabels, 7)
require.Len(t, page.LengthLabels, 6)
require.Len(t, page.ReplyLabels, 6)
// 句子里必须是完整星期名:热力图列头的 stats.wd.* 是单字("一"/"三"),
// 复用到句子里会读成「提问最集中在三 8 点前后」。
require.Contains(t, strings.Join(page.Insights, "\n"), "提问最集中在周一 8 点前后。")
}
+6 -2
View File
@@ -108,10 +108,14 @@ func insights(lang string, ov *Overview) []string {
}
if ov.HeatmapMax > 0 {
// DOW 以周日为 0,展示顺序以周一为 1,换算到 stats.wd.N。
// DOW 以周日为 0,展示顺序以周一为 1,换算到 stats.weekday.N。
//
// 句子里必须用完整星期名(stats.weekday.*),不能用热力图列头那套
// 单字标签(stats.wd.* = "一"/"Mon"):列头要窄,句子里"三 19 点"
// 会被读成数字 3,英文那边则直接是 "Wed 19:00"。
wd := (ov.BusiestWD+6)%7 + 1
out = append(out, t("stats.insight.busiest",
i18n.T(lang, fmt.Sprintf("stats.wd.%d", wd)), ov.BusiestHr))
i18n.T(lang, fmt.Sprintf("stats.weekday.%d", wd)), ov.BusiestHr))
}
if ov.HasPrevMonth {