From 722b5de88da74257f4f86f7b64dc823abeb5c704 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sun, 15 Mar 2026 13:12:17 +0100 Subject: [PATCH] feat: polish journey columns with bar charts, count pills, colored selection, dotted connectors --- components/journeys/ColumnJourney.tsx | 100 +++++++++++++++++--------- 1 file changed, 67 insertions(+), 33 deletions(-) diff --git a/components/journeys/ColumnJourney.tsx b/components/journeys/ColumnJourney.tsx index 04c77fa..0e420c1 100644 --- a/components/journeys/ColumnJourney.tsx +++ b/components/journeys/ColumnJourney.tsx @@ -1,6 +1,6 @@ 'use client' -import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' +import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' import { TreeStructure } from '@phosphor-icons/react' import type { PathTransition } from '@/lib/api/journeys' @@ -121,28 +121,35 @@ function ColumnHeader({ color: string }) { return ( -
+
{column.index + 1} -
- - {column.totalSessions.toLocaleString()} visitors +
+ + {column.totalSessions.toLocaleString()} - {column.dropOffPercent !== 0 && ( - - {column.dropOffPercent > 0 ? '+' : ''} - {column.dropOffPercent}% +
+ + visitors - )} + {column.dropOffPercent !== 0 && ( + + {column.dropOffPercent > 0 ? '+' : ''} + {column.dropOffPercent}% + + )} +
+ {/* Colored connector line from header to cards */} +
) } @@ -150,19 +157,23 @@ function ColumnHeader({ function PageRow({ page, colIndex, + colColor, columnTotal, + maxCount, isSelected, isOther, onClick, }: { page: ColumnPage colIndex: number + colColor: string columnTotal: number + maxCount: number isSelected: boolean isOther: boolean onClick: () => void }) { - const pct = columnTotal > 0 ? Math.round((page.sessionCount / columnTotal) * 100) : 0 + const barWidth = maxCount > 0 ? (page.sessionCount / maxCount) * 100 : 0 return (