From 9343af0c46a139fd8e182ce44dbb4fcb0934ffed Mon Sep 17 00:00:00 2001 From: LHaghfoss Date: Wed, 25 Nov 2026 22:52:13 +0100 Subject: [PATCH] fix(desktop): enlarge the activity grid's cells and drop their outline Cells are 14px squares with a fixed 2px corner, the grid scrolls sideways and opens on the latest week, and streak days lose their ring. --- apps/desktop/src/index.css | 2 +- apps/desktop/src/ui/ActivityProfile.tsx | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/desktop/src/index.css b/apps/desktop/src/index.css index 22e34ead3..11d2453ee 100644 --- a/apps/desktop/src/index.css +++ b/apps/desktop/src/index.css @@ -1201,7 +1201,7 @@ 0 0 14px color-mix(in srgb, var(--rc-bg) 60%, transparent); } -/* A day of the activity heatmap's grid: 2px, under the smallest radius step, on a 7px cell. */ +/* A day of the activity heatmap's grid: a fixed 2px corner, so the cells stay squares at any radius setting. */ .rc-heat-cell { border-radius: 2px; } diff --git a/apps/desktop/src/ui/ActivityProfile.tsx b/apps/desktop/src/ui/ActivityProfile.tsx index 2560d6175..d0a0738f9 100644 --- a/apps/desktop/src/ui/ActivityProfile.tsx +++ b/apps/desktop/src/ui/ActivityProfile.tsx @@ -5,7 +5,7 @@ * the page below is set to. */ -import { useMemo, useState } from "react"; +import { useLayoutEffect, useMemo, useRef, useState } from "react"; import type { UsageReport } from "../acp/rustcode"; import { count } from "../lib/plural"; import { @@ -67,10 +67,16 @@ function cellTip(cell: ProfileCell, mode: ProfileMode): string { export function ActivityProfile({ report, error }: { report: UsageReport | null; error?: string | null }) { const [mode, setMode] = useState("daily"); + const scroller = useRef(null); const rows = report?.rows; const summary = useMemo(() => (rows ? profileSummary(rows) : undefined), [rows]); const columns = useMemo(() => (rows ? profileWeeks(rows, mode) : []), [rows, mode]); const months = useMemo(() => monthLabels(columns), [columns]); + const loaded = Boolean(rows); + useLayoutEffect(() => { + const el = scroller.current; + if (loaded && el) el.scrollLeft = el.scrollWidth; + }, [loaded]); const streak = summary?.streak; const best = @@ -156,14 +162,14 @@ export function ActivityProfile({ report, error }: { report: UsageReport | null; /> )} -
+
{!rows ? ( ) : (
{columns.map((week, index) => ( @@ -174,13 +180,7 @@ export function ActivityProfile({ report, error }: { report: UsageReport | null; {week.map((cell, day) => cell ? ( - + ) : (