mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Keep activity chart bars visible on long ranges
This commit is contained in:
1 parent
288975f7b8
commit
dd60803944
1 file changed
+3
-2
@@ -1,4 +1,5 @@
|
||||
import type { SessionStatsActivity } from '@opencode-manager/shared/opencode'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
interface UsageActivityChartProps {
|
||||
activity: SessionStatsActivity[]
|
||||
@@ -12,7 +13,7 @@ export function UsageActivityChart({ activity }: UsageActivityChartProps) {
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<h2 className="text-sm font-medium">Activity</h2>
|
||||
<div className="flex h-32 items-end gap-1">
|
||||
<div className={cn('flex h-32 items-end overflow-x-auto', activity.length > 31 ? 'gap-px' : 'gap-1')}>
|
||||
{activity.map((day) => {
|
||||
const height = maxSteps === 0 ? 0 : Math.max(2, Math.round((day.steps / maxSteps) * 100))
|
||||
const label = `${day.date}: ${day.steps} steps`
|
||||
@@ -22,7 +23,7 @@ export function UsageActivityChart({ activity }: UsageActivityChartProps) {
|
||||
role="img"
|
||||
aria-label={label}
|
||||
title={label}
|
||||
className="flex-1 rounded-sm bg-primary"
|
||||
className="min-w-0.5 flex-1 rounded-sm bg-primary"
|
||||
style={{ height: `${height}%` }}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user