Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Enhance layout and responsiveness in Funnels and Retention pages

Bill Yangb61e04301270
diff --git a/client/src/app/[site]/funnels/components/Funnel.tsx b/client/src/app/[site]/funnels/components/Funnel.tsx
index ff6d14215..60061e2f0 100644
--- a/client/src/app/[site]/funnels/components/Funnel.tsx
+++ b/client/src/app/[site]/funnels/components/Funnel.tsx
@@ -124,14 +124,14 @@ export function Funnel({
return (
<div
key={step.stepNumber}
- className=" rounded-md p-1 relative pl-3 border-l border-l-neutral-800 first:border-l-0"
+ className="text-sm rounded-md p-1 relative pl-3 border-l border-l-neutral-800 first:border-l-0"
>
<div className="font-medium flex items-center gap-2">
{step.stepName}
</div>
{/* Entering users */}
- <div className="mt-3">
+ <div className="mt-2">
<div className="flex items-center text-green-600 dark:text-green-500">
<ArrowRight className="w-4 h-4 mr-2" />
<div>
diff --git a/client/src/app/[site]/funnels/components/FunnelRow.tsx b/client/src/app/[site]/funnels/components/FunnelRow.tsx
index 8b78d6540..f33dd31fd 100644
--- a/client/src/app/[site]/funnels/components/FunnelRow.tsx
+++ b/client/src/app/[site]/funnels/components/FunnelRow.tsx
@@ -104,12 +104,12 @@ export function FunnelRow({ funnel }: FunnelRowProps) {
return (
<Card className="mb-4 overflow-hidden">
{/* Header row (always visible) */}
- <div className="flex items-center justify-between p-4">
+ <div className="flex items-center justify-between p-3">
<div
- className="flex items-center space-x-4 flex-grow cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-900 transition-colors"
+ className="flex items-center flex-grow cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-900 transition-colors"
onClick={handleExpand}
>
- <div className="bg-neutral-100 dark:bg-neutral-800 p-2 rounded-md">
+ <div className="hidden md:block bg-neutral-100 dark:bg-neutral-800 p-2 rounded-md mr-4">
<FunnelIcon className="h-5 w-5 text-neutral-500" />
</div>
<div className="flex-grow">
diff --git a/client/src/app/[site]/funnels/page.tsx b/client/src/app/[site]/funnels/page.tsx
index db773df5b..e18931216 100644
--- a/client/src/app/[site]/funnels/page.tsx
+++ b/client/src/app/[site]/funnels/page.tsx
@@ -8,6 +8,7 @@ import { PlusCircle } from "lucide-react";
import { Skeleton } from "@/components/ui/skeleton";
import { useStore } from "@/lib/store";
import { FunnelRow } from "./components/FunnelRow";
+import { MobileSidebar } from "../../../components/MobileSidebar";
export default function FunnelsPage() {
const { site } = useStore();
@@ -16,8 +17,10 @@ export default function FunnelsPage() {
if (isLoading) {
return (
<div className="p-4 max-w-[1300px] mx-auto space-y-4">
- <div className="flex justify-between items-center mb-6">
- <h1 className="text-2xl font-bold">Funnels</h1>
+ <div className="flex justify-between items-center mb-3">
+ <div>
+ <MobileSidebar />
+ </div>
<Skeleton className="h-10 w-32" />
</div>
{[1, 2, 3].map((i) => (
@@ -29,8 +32,10 @@ export default function FunnelsPage() {
return (
<div className="p-2 md:p-4 max-w-[1300px] mx-auto space-y-3">
- <div className="flex justify-between items-center mb-6">
- <h1 className="text-2xl font-bold">Funnels</h1>
+ <div className="flex justify-between items-center mb-3">
+ <div>
+ <MobileSidebar />
+ </div>
<CreateFunnelDialog />
</div>
diff --git a/client/src/app/[site]/retention/page.tsx b/client/src/app/[site]/retention/page.tsx
index 983f64863..40569f02a 100644
--- a/client/src/app/[site]/retention/page.tsx
+++ b/client/src/app/[site]/retention/page.tsx
@@ -30,6 +30,7 @@ import {
TooltipTrigger,
} from "../../../components/ui/tooltip";
import { RetentionChart } from "./RetentionChart";
+import { MobileSidebar } from "../../../components/MobileSidebar";
// Available time range options (in days)
const RANGE_OPTIONS = [
@@ -141,52 +142,57 @@ export default function RetentionPage() {
// Common filters for both views
const FilterControls = () => (
- <div className="flex items-center gap-4 flex-wrap justify-end">
- <div className="flex items-center gap-2">
- <Label htmlFor="time-range" className="text-sm whitespace-nowrap">
- Time Range:
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <HelpCircle className="h-3.5 w-3.5 ml-1 inline-block text-neutral-400" />
- </TooltipTrigger>
- <TooltipContent>
- <p className="w-[200px] text-xs">
- Amount of historical data to include in the retention
- calculation. All available periods within this timeframe will
- be shown.
- </p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- </Label>
- <Select
- value={timeRange.toString()}
- onValueChange={handleRangeChange}
- disabled={isLoading}
- >
- <SelectTrigger id="time-range" className="w-28" size="sm">
- <SelectValue placeholder="90 days" />
- </SelectTrigger>
- <SelectContent size="sm">
- {RANGE_OPTIONS.map((option) => (
- <SelectItem key={option.value} value={option.value}>
- {option.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ <div className="flex justify-between items-center">
+ <div>
+ <MobileSidebar />
+ </div>
+ <div className="flex items-center gap-3 flex-wrap justify-end">
+ <div className="flex items-center gap-2">
+ <Label htmlFor="time-range" className="text-sm whitespace-nowrap">
+ Time Range:
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <HelpCircle className="h-3.5 w-3.5 ml-1 inline-block text-neutral-400" />
+ </TooltipTrigger>
+ <TooltipContent>
+ <p className="w-[200px] text-xs">
+ Amount of historical data to include in the retention
+ calculation. All available periods within this timeframe
+ will be shown.
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </Label>
+ <Select
+ value={timeRange.toString()}
+ onValueChange={handleRangeChange}
+ disabled={isLoading}
+ >
+ <SelectTrigger id="time-range" className="w-28" size="sm">
+ <SelectValue placeholder="90 days" />
+ </SelectTrigger>
+ <SelectContent size="sm">
+ {RANGE_OPTIONS.map((option) => (
+ <SelectItem key={option.value} value={option.value}>
+ {option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <Tabs value={mode} onValueChange={handleModeChange}>
+ <TabsList>
+ <TabsTrigger value="day" disabled={isLoading}>
+ Daily
+ </TabsTrigger>
+ <TabsTrigger value="week" disabled={isLoading}>
+ Weekly
+ </TabsTrigger>
+ </TabsList>
+ </Tabs>
</div>
- <Tabs value={mode} onValueChange={handleModeChange}>
- <TabsList>
- <TabsTrigger value="day" disabled={isLoading}>
- Daily
- </TabsTrigger>
- <TabsTrigger value="week" disabled={isLoading}>
- Weekly
- </TabsTrigger>
- </TabsList>
- </Tabs>
</div>
);
@@ -195,9 +201,6 @@ export default function RetentionPage() {
return (
<div className="pt-4">
<Card>
- <CardHeader>
- <CardTitle>User Retention</CardTitle>
- </CardHeader>
<CardContent>
<div className="p-8 text-center">
<div className="text-red-500 mb-2 font-medium">
@@ -219,9 +222,6 @@ export default function RetentionPage() {
return (
<div className="pt-4">
<Card>
- <CardHeader>
- <CardTitle>User Retention</CardTitle>
- </CardHeader>
<CardContent>
<div className="p-8 text-center">
<div className="text-neutral-300 mb-2 font-medium">
@@ -244,19 +244,23 @@ export default function RetentionPage() {
: [];
return (
- <div className="p-2 md:p-4 max-w-[1300px] mx-auto space-y-3">
+ <div className="p-2 md:p-4 max-w-[1300px] mx-auto flex flex-col gap-3">
{/* Single Card containing both chart and grid */}
+ <FilterControls />
<Card>
<CardHeader className="flex flex-row items-center justify-between pb-2">
- <CardTitle>User Retention</CardTitle>
- <FilterControls />
+ <CardTitle>Retention</CardTitle>
</CardHeader>
<CardContent className="space-y-6">
- {/* Retention Chart */}
- {isLoading ? null : data ? (
+ {isLoading ? (
+ <ThreeDotLoader />
+ ) : data ? (
<RetentionChart data={data} isLoading={false} mode={mode} />
) : null}
-
+ </CardContent>
+ </Card>
+ <Card className="pt-3">
+ <CardContent className="space-y-6 px-2">
<div>
{isLoading ? (
<ThreeDotLoader />