睡眠页默认窗口改为 14 天

30 根堆叠柱在常规宽度下每根约 10px,扣掉段间 2px 间隙后深睡那层
细到难以辨认,悬停命中区也逼近 24px 下限。默认收到 14 天让柱宽
翻倍,更长的窗口仍可手动选择。

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
ericwyuan
2026-08-23 21:36:28 +08:00
parent 6a5cfa7806
commit a17d6dde9b

View File

@@ -15,7 +15,10 @@ function avg(values: Array<number | null | undefined>): number | null {
function Sleep() {
const [days, setDays] = useState<HealthDay[]>([]);
const [range, setRange] = useState(30);
// 14 by default: the stacked chart needs bars wide enough to read the
// thinnest stage and to give hover a ~24px hit target. Longer windows stay
// available for the trend, where density matters less.
const [range, setRange] = useState(14);
const [loading, setLoading] = useState(true);
const [error, setError] = useState('');