睡眠页默认窗口改为 14 天
30 根堆叠柱在常规宽度下每根约 10px,扣掉段间 2px 间隙后深睡那层 细到难以辨认,悬停命中区也逼近 24px 下限。默认收到 14 天让柱宽 翻倍,更长的窗口仍可手动选择。 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,10 @@ function avg(values: Array<number | null | undefined>): number | null {
|
|||||||
|
|
||||||
function Sleep() {
|
function Sleep() {
|
||||||
const [days, setDays] = useState<HealthDay[]>([]);
|
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 [loading, setLoading] = useState(true);
|
||||||
const [error, setError] = useState('');
|
const [error, setError] = useState('');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user