Skip to content

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

Update UI components for improved styling and functionality

Bill Yang7cda0a6979e6
diff --git a/client/src/app/[site]/globe/components/ModeSelector.tsx b/client/src/app/[site]/globe/components/ModeSelector.tsx
index 73c4b6374..07373ce9a 100644
--- a/client/src/app/[site]/globe/components/ModeSelector.tsx
+++ b/client/src/app/[site]/globe/components/ModeSelector.tsx
@@ -18,7 +18,7 @@ function TabButton({ active, onClick, icon, label }: TabButtonProps) {
className={cn(
"h-[24px] inline-flex items-center justify-center whitespace-nowrap rounded px-2 py-1 text-xs font-medium transition-all",
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",
- active ? "bg-white/10 text-white" : "text-neutral-400 hover:text-neutral-200 hover:bg-white/[0.03]"
+ active ? "bg-neutral-800/50 text-white" : "text-neutral-200 hover:text-neutral-100 hover:bg-neutral-800/50"
)}
>
{icon}
@@ -33,12 +33,12 @@ export default function MapViewSelector() {
return (
<div className="flex items-center gap-2 overflow-x-auto w-full">
<button
- className="text-xs font-medium rounded-lg bg-neutral-900/60 text-neutral-200 backdrop-blur-sm p-1.5 border border-white/10 hover:bg-neutral-700/60 hover:text-white transition-all"
+ className="text-xs font-medium rounded-lg bg-neutral-900/70 text-neutral-200 backdrop-blur-sm p-1.5 border border-neutral-800/50 hover:bg-neutral-800 hover:text-white transition-all"
onClick={() => setMapMode(mapMode === "2D" ? "3D" : "2D")}
>
{mapMode === "2D" ? "2D" : "3D"}
</button>
- <div className="flex items-center gap-0.5 rounded-lg bg-neutral-900/40 backdrop-blur-sm p-0.5 border border-white/10">
+ <div className="flex items-center gap-0.5 rounded-lg bg-neutral-900/50 backdrop-blur-sm p-0.5 border border-neutral-800/50">
<TabButton
active={mapView === "timeline"}
onClick={() => setMapView("timeline")}
diff --git a/client/src/app/[site]/globe/components/TimelineScrubber.tsx b/client/src/app/[site]/globe/components/TimelineScrubber.tsx
index 1b2bddb02..dd694bafd 100644
--- a/client/src/app/[site]/globe/components/TimelineScrubber.tsx
+++ b/client/src/app/[site]/globe/components/TimelineScrubber.tsx
@@ -139,7 +139,7 @@ export function TimelineScrubber() {
if (isLoading) {
return (
- <div className="flex items-center justify-center gap-2 text-xs text-neutral-400 h-[66px] w-full">
+ <div className="flex items-center justify-center gap-2 text-xs text-neutral-400 h-[70px] w-full">
<div className="w-4 h-4 border-2 border-neutral-600 border-t-accent-500 rounded-full animate-spin" />
<span>Loading sessions...</span>
</div>
@@ -166,13 +166,13 @@ export function TimelineScrubber() {
return (
<div
key={index}
- className="flex-1 transition-all duration-150 cursor-pointer hover:opacity-80"
style={{
height: `${heightPercentage}%`,
- backgroundColor: isActive ? "hsl(var(--accent-600))" : "rgba(115, 115, 115, 0.4)",
+ backgroundColor: isActive ? "hsl(var(--accent-600))" : "rgba(100, 100, 100, 0.5)",
minHeight: count > 0 ? "2px" : "0px",
opacity: isCalculating ? 0.5 : 1,
}}
+ className="flex-1 transition-all duration-150 cursor-pointer"
title={`${count} session${count !== 1 ? "s" : ""}`}
onClick={() => {
setLocalSliderIndex(index);
@@ -186,21 +186,21 @@ export function TimelineScrubber() {
</div>
<TimelineSlider value={[localSliderIndex]} max={timeWindows.length - 1} onValueChange={handleSliderChange} />
- <div className="flex items-center justify-between mt-1">
- <div className="flex items-center gap-1 w-full">
+ <div className="flex items-center justify-between mt-2">
+ <div className="flex items-center gap-1 bg-neutral-800/50 pr-2.5 pl-1 rounded-full">
<button
onClick={() => setIsPlaying(!isPlaying)}
- className="p-1.5 rounded hover:bg-neutral-800 transition-colors"
+ className="p-1.5 rounded"
aria-label={isPlaying ? "Pause" : "Play"}
>
- {isPlaying ? <Pause className="w-4 h-4 text-neutral-300" /> : <Play className="w-4 h-4 text-neutral-300" />}
+ {isPlaying ? <Pause className="w-4 h-4 text-neutral-100" /> : <Play className="w-4 h-4 text-neutral-100" />}
</button>
- <span className="text-xs text-neutral-400 min-w-[80px]">
+ <span className="text-xs text-neutral-100">
{displayTime ? formatTimelineTime(displayTime, windowSize) : ""}
</span>
</div>
- <div className="flex items-center gap-3">
- <div className="text-xs text-neutral-400 flex items-center gap-1 whitespace-nowrap">
+ <div className="flex items-center gap-3 bg-neutral-800/50 px-2.5 py-1 rounded-full">
+ <div className="text-xs text-neutral-100 flex items-center gap-1 whitespace-nowrap">
<span className="font-bold text-accent-400">
{activeSessions.length.toLocaleString()} / {allSessions.length.toLocaleString()}
</span>{" "}
diff --git a/client/src/app/[site]/globe/page.tsx b/client/src/app/[site]/globe/page.tsx
index a38a0a490..f6c07dce3 100644
--- a/client/src/app/[site]/globe/page.tsx
+++ b/client/src/app/[site]/globe/page.tsx
@@ -92,7 +92,7 @@ export default function GlobePage() {
setManualWindowSize(newSize);
}}
>
- <SelectTrigger className="w-[100px]" size="sm">
+ <SelectTrigger className="w-[60px]" size="sm">
<SelectValue />
</SelectTrigger>
<SelectContent>
diff --git a/client/src/app/[site]/globe/timelineUtils.ts b/client/src/app/[site]/globe/timelineUtils.ts
index 69ff56410..13acdb4e4 100644
--- a/client/src/app/[site]/globe/timelineUtils.ts
+++ b/client/src/app/[site]/globe/timelineUtils.ts
@@ -26,16 +26,16 @@ export function calculateWindowSize(startTime: DateTime, endTime: DateTime): num
* Available window size options for the dropdown
*/
export const WINDOW_SIZE_OPTIONS = [
- { value: 1, label: "1 minute" },
- { value: 5, label: "5 minutes" },
- { value: 15, label: "15 minutes" },
- { value: 30, label: "30 minutes" },
- { value: 60, label: "1 hour" },
- { value: 180, label: "3 hours" },
- { value: 360, label: "6 hours" },
- { value: 720, label: "12 hours" },
- { value: 1440, label: "1 day" },
- { value: 4320, label: "3 days" },
+ { value: 1, label: "1m" },
+ { value: 5, label: "5m" },
+ { value: 15, label: "15m" },
+ { value: 30, label: "30m" },
+ { value: 60, label: "1h" },
+ { value: 180, label: "3h" },
+ { value: 360, label: "6h" },
+ { value: 720, label: "12h" },
+ { value: 1440, label: "1d" },
+ { value: 4320, label: "3d" },
];
/**
diff --git a/client/src/components/ui/select.tsx b/client/src/components/ui/select.tsx
index f23cb3919..c3305a9a5 100644
--- a/client/src/components/ui/select.tsx
+++ b/client/src/components/ui/select.tsx
@@ -21,7 +21,7 @@ const SelectTrigger = React.forwardRef<
<SelectPrimitive.Trigger
ref={ref}
className={cn(
- "flex w-full items-center justify-between whitespace-nowrap rounded-md border border-neutral-200 bg-transparent px-3 text-sm shadow-sm ring-offset-white placeholder:text-neutral-500 focus:outline-none focus:ring-1 focus:ring-neutral-950 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 dark:border-neutral-750 dark:ring-offset-neutral-950 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-300",
+ "flex w-full items-center justify-between whitespace-nowrap rounded-md border border-neutral-200 bg-neutral-900/70 px-3 text-sm shadow-sm ring-offset-white placeholder:text-neutral-500 focus:outline-none focus:ring-1 focus:ring-neutral-950 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 dark:border-neutral-750 dark:ring-offset-neutral-950 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-300",
size === "default" && "h-9 py-2",
size === "sm" && "h-7 py-1 text-xs",
className
diff --git a/client/src/components/ui/timeline-slider.tsx b/client/src/components/ui/timeline-slider.tsx
index 5f441d0cb..2153bb22d 100644
--- a/client/src/components/ui/timeline-slider.tsx
+++ b/client/src/components/ui/timeline-slider.tsx
@@ -14,10 +14,10 @@ const TimelineSlider = React.forwardRef<
className={cn("relative flex w-full touch-none select-none items-center", className)}
{...props}
>
- <SliderPrimitive.Track className="relative h-0.5 w-full grow overflow-hidden rounded-full bg-neutral-800/50">
- <SliderPrimitive.Range className="absolute h-full bg-accent-400" />
+ <SliderPrimitive.Track className="relative h-0.5 w-full grow overflow-hidden rounded-full bg-neutral-800">
+ <SliderPrimitive.Range className="absolute h-full bg-accent-500" />
</SliderPrimitive.Track>
- <SliderPrimitive.Thumb className="block h-2.5 w-2.5 rounded-full border border-accent-400 bg-accent-400 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-400 focus-visible:ring-offset-2 focus-visible:ring-offset-neutral-900 disabled:pointer-events-none disabled:opacity-50 hover:scale-125 hover:shadow-md cursor-grab active:cursor-grabbing active:scale-110" />
+ <SliderPrimitive.Thumb className="block h-2.5 w-2.5 rounded-full border border-accent-300 bg-accent-300 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-400 focus-visible:ring-offset-2 focus-visible:ring-offset-neutral-900 disabled:pointer-events-none disabled:opacity-50 hover:scale-125 hover:shadow-md cursor-grab active:cursor-grabbing active:scale-110" />
</SliderPrimitive.Root>
));
TimelineSlider.displayName = SliderPrimitive.Root.displayName;