diff --git a/components/behavior/FrustrationTable.tsx b/components/behavior/FrustrationTable.tsx index cf1041c..789ce5d 100644 --- a/components/behavior/FrustrationTable.tsx +++ b/components/behavior/FrustrationTable.tsx @@ -65,6 +65,9 @@ function SelectorCell({ selector }: { selector: string }) { ) } +const GRID_WITH_AVG = 'grid grid-cols-[1fr_60px_50px_64px_64px_40px] items-center gap-2 h-9 px-2 -mx-2' +const GRID_NO_AVG = 'grid grid-cols-[1fr_60px_64px_64px_40px] items-center gap-2 h-9 px-2 -mx-2' + function Row({ item, showAvgClicks, @@ -73,32 +76,30 @@ function Row({ showAvgClicks?: boolean }) { return ( -
-
+
+
{item.page_path}
-
- {showAvgClicks && item.avg_click_count != null && ( - - avg {item.avg_click_count.toFixed(1)} - - )} - - {item.sessions} {item.sessions === 1 ? 'session' : 'sessions'} + {showAvgClicks && ( + + {item.avg_click_count != null ? item.avg_click_count.toFixed(1) : '–'} - - {formatRelativeTime(item.last_seen)} - - - {formatNumber(item.count)} - -
+ )} + + {item.sessions} + + + {formatRelativeTime(item.last_seen)} + + + {formatNumber(item.count)} +
) } @@ -166,17 +167,12 @@ export default function FrustrationTable({ ) : hasData ? (
{/* Column headers */} -
-
- Selector - Page -
-
- {showAvgClicks && Avg} - Sessions - Last Seen - Count -
+
+ Selector / Page + {showAvgClicks && Avg} + Sessions + Last Seen + Count
{items.map((item, i) => ( diff --git a/components/behavior/FrustrationTrend.tsx b/components/behavior/FrustrationTrend.tsx index afb9b01..879b720 100644 --- a/components/behavior/FrustrationTrend.tsx +++ b/components/behavior/FrustrationTrend.tsx @@ -3,14 +3,6 @@ import { TrendUp } from '@phosphor-icons/react' import { Pie, PieChart } from 'recharts' -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from '@/components/ui/card' import { ChartContainer, ChartTooltip, @@ -48,7 +40,7 @@ const chartConfig = { }, dead_clicks: { label: 'Dead Clicks', - color: '#F59E0B', + color: '#E04E0A', }, prev_rage_clicks: { label: 'Prev Rage Clicks', @@ -106,12 +98,17 @@ export default function FrustrationTrend({ summary, loading }: FrustrationTrendP } return ( - - - Frustration Trend - Current vs. previous period - - +
+
+

+ Frustration Trend +

+
+

+ Rage and dead clicks split across current and previous period +

+ +
- - -
- {totalChange !== null ? ( - <> - {totalChange > 0 ? 'Up' : totalChange < 0 ? 'Down' : 'No change'} by {Math.abs(totalChange)}% vs previous period - - ) : totalCurrent > 0 ? ( - <> - {totalCurrent.toLocaleString()} new signals this period - - ) : ( - 'No frustration signals detected' - )} -
-
- {totalCurrent.toLocaleString()} total signals in current period -
-
- +
+ +
+ {totalChange !== null ? ( + <> + {totalChange > 0 ? 'Up' : totalChange < 0 ? 'Down' : 'No change'} by {Math.abs(totalChange)}% vs previous period + + ) : totalCurrent > 0 ? ( + <> + {totalCurrent.toLocaleString()} new signals this period + + ) : ( + 'No frustration signals detected' + )} +
+
) }