Skip to content

Commit 570f50e

Browse files
wesmclaude
andcommitted
fix: make activity calendar full-width, combine day/hour charts
Move the Heatmap (activity calendar) to a full-width card so the 1-year calendar fits without clipping. Combine ActivityTimeline and HourOfWeekHeatmap into a single "Activity by Day and Hour" card. Fix pre-existing TS7023 error in createVirtualizer.test.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3b0cd09 commit 570f50e

File tree

4 files changed

+46
-47
lines changed

4 files changed

+46
-47
lines changed

frontend/src/lib/components/analytics/ActivityTimeline.svelte

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164

165165
<div class="timeline-container">
166166
<div class="timeline-header">
167-
<h3 class="chart-title">Activity</h3>
168167
<div class="controls">
169168
<div class="metric-toggle">
170169
<button
@@ -302,12 +301,6 @@
302301
margin-bottom: 8px;
303302
}
304303
305-
.chart-title {
306-
font-size: 12px;
307-
font-weight: 600;
308-
color: var(--text-primary);
309-
}
310-
311304
.controls {
312305
display: flex;
313306
gap: 8px;

frontend/src/lib/components/analytics/AnalyticsPage.svelte

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
import { analytics } from "../../stores/analytics.svelte.js";
1616
import { exportAnalyticsCSV } from "../../utils/csv-export.js";
1717
18+
function shortTz(tz: string): string {
19+
const slash = tz.lastIndexOf("/");
20+
return slash >= 0
21+
? tz.slice(slash + 1).replace(/_/g, " ")
22+
: tz;
23+
}
24+
1825
const REFRESH_INTERVAL_MS = 5 * 60 * 1000;
1926
2027
function handleExportCSV() {
@@ -70,16 +77,22 @@
7077
<SummaryCards />
7178

7279
<div class="chart-grid">
73-
<div class="chart-panel">
80+
<div class="chart-panel wide">
7481
<Heatmap />
7582
</div>
7683

7784
<div class="chart-panel">
78-
<HourOfWeekHeatmap />
79-
</div>
80-
81-
<div class="chart-panel">
85+
<div class="chart-header">
86+
<h3 class="chart-title">
87+
Activity by Day and Hour
88+
<span class="tz-label">
89+
{shortTz(analytics.timezone)}
90+
</span>
91+
</h3>
92+
</div>
8293
<ActivityTimeline />
94+
<div class="chart-divider"></div>
95+
<HourOfWeekHeatmap />
8396
</div>
8497

8598
<div class="chart-panel">
@@ -191,6 +204,32 @@
191204
grid-column: 1 / -1;
192205
}
193206
207+
.chart-header {
208+
display: flex;
209+
align-items: center;
210+
gap: 8px;
211+
margin-bottom: 8px;
212+
}
213+
214+
.chart-title {
215+
font-size: 12px;
216+
font-weight: 600;
217+
color: var(--text-primary);
218+
}
219+
220+
.tz-label {
221+
font-weight: 400;
222+
color: var(--text-muted);
223+
font-size: 10px;
224+
margin-left: 4px;
225+
}
226+
227+
.chart-divider {
228+
height: 1px;
229+
background: var(--border-muted);
230+
margin: 12px 0;
231+
}
232+
194233
@media (max-width: 800px) {
195234
.chart-grid {
196235
grid-template-columns: 1fr;

frontend/src/lib/components/analytics/HourOfWeekHeatmap.svelte

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,9 @@
137137
return hour !== sh;
138138
}
139139
140-
function shortTz(tz: string): string {
141-
const slash = tz.lastIndexOf("/");
142-
return slash >= 0
143-
? tz.slice(slash + 1).replace(/_/g, " ")
144-
: tz;
145-
}
146140
</script>
147141

148142
<div class="how-container">
149-
<div class="chart-header">
150-
<h3 class="chart-title">
151-
Activity by Day and Hour
152-
<span class="tz-label">{shortTz(analytics.timezone)}</span>
153-
</h3>
154-
</div>
155-
156143
{#if analytics.loading.hourOfWeek}
157144
<div class="loading">Loading...</div>
158145
{:else if analytics.errors.hourOfWeek}
@@ -261,26 +248,6 @@
261248
flex: 1;
262249
}
263250
264-
.chart-header {
265-
display: flex;
266-
align-items: center;
267-
gap: 8px;
268-
margin-bottom: 8px;
269-
}
270-
271-
.chart-title {
272-
font-size: 12px;
273-
font-weight: 600;
274-
color: var(--text-primary);
275-
}
276-
277-
.tz-label {
278-
font-weight: 400;
279-
color: var(--text-muted);
280-
font-size: 10px;
281-
margin-left: 4px;
282-
}
283-
284251
.how-scroll {
285252
overflow-x: auto;
286253
padding-bottom: 4px;

frontend/src/lib/virtual/createVirtualizer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,14 @@ describe('createVirtualizer reactivity', () => {
247247
options: {
248248
count: 10,
249249
getScrollElement: () => document.createElement('div'),
250-
estimateSize: () => 50,
250+
estimateSize: (): number => 50,
251251
},
252252
},
253253
{
254254
type: 'window' as const,
255255
options: {
256256
count: 20,
257-
estimateSize: () => 50,
257+
estimateSize: (): number => 50,
258258
},
259259
},
260260
])(

0 commit comments

Comments
 (0)