diff --git a/CHANGELOG.md b/CHANGELOG.md index a356cb1..3e9d3a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Improved +- **Scroll Depth is now a radar chart.** The Scroll Depth panel has been redesigned from a bar chart into a radar chart. The four scroll milestones (25%, 50%, 75%, 100%) are plotted as axes, with the filled shape showing how far visitors are getting through your pages at a glance. - **Polished Goals & Events panel.** The Goals & Events block on your dashboard got a visual refresh to match the style of the Pages, Referrers, and Locations panels. Events are now ranked with a number on the left, counts are shown in a consistent style, and hovering any row reveals what percentage of total events that action accounts for — sliding in smoothly from the right. - **Smarter bot protection.** The security checks on shared dashboard access and organization settings now use action-specific tokens tied to each page. A token earned on one page can't be reused on another, making it harder for automated tools to bypass the captcha. - **More resilient under Redis outages.** If the caching layer goes down temporarily, Pulse now continues enforcing rate limits using an in-memory fallback instead of letting all traffic through unchecked. This prevents one infrastructure hiccup from snowballing into a bigger problem. diff --git a/components/dashboard/ScrollDepth.tsx b/components/dashboard/ScrollDepth.tsx index 92f416f..d9157cb 100644 --- a/components/dashboard/ScrollDepth.tsx +++ b/components/dashboard/ScrollDepth.tsx @@ -1,6 +1,6 @@ 'use client' -import { formatNumber } from '@ciphera-net/ui' +import { PolarAngleAxis, PolarGrid, Radar, RadarChart, Tooltip } from 'recharts' import { BarChartIcon } from '@ciphera-net/ui' import type { GoalCountStat } from '@/lib/api/stats' @@ -22,6 +22,11 @@ export default function ScrollDepth({ goalCounts, totalPageviews }: ScrollDepthP const hasData = scrollCounts.size > 0 && totalPageviews > 0 + const chartData = THRESHOLDS.map((threshold) => ({ + label: `${threshold}%`, + value: totalPageviews > 0 ? Math.round(((scrollCounts.get(threshold) ?? 0) / totalPageviews) * 100) : 0, + })) + return (