From 539bf5a7ea65616cd44151c0ad746383f323406e Mon Sep 17 00:00:00 2001 From: Danny White <3104761+dnywh@users.noreply.github.com> Date: Mon, 17 Nov 2025 12:05:53 +1100 Subject: [PATCH] style and stack --- .../NamespaceWithTables/index.tsx | 73 +++++++++++-------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/index.tsx b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/index.tsx index 44ba0606f68..ee79025a1c1 100644 --- a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/index.tsx +++ b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/index.tsx @@ -1,4 +1,4 @@ -import { ChevronRight, Database, FileText, Info, Loader2, Plus, RefreshCw } from 'lucide-react' +import { ChevronRight, Database, Info, Loader2, Plus, RefreshCw } from 'lucide-react' import { useTheme } from 'next-themes' import { useEffect, useMemo, useRef, useState } from 'react' @@ -48,7 +48,6 @@ const SchemaFlowDiagram = ({ const containerRef = useRef(null) const sourceRef = useRef(null) const targetRef = useRef(null) - const [pathData, setPathData] = useState('') // Calculate dot color based on theme const dotColor = useMemo( @@ -56,26 +55,19 @@ const SchemaFlowDiagram = ({ [resolvedTheme] ) + const [lineStart, setLineStart] = useState<{ x: number; y: number } | null>(null) + useEffect(() => { const updatePath = () => { if (!containerRef.current || !sourceRef.current || !targetRef.current) return const containerRect = containerRef.current.getBoundingClientRect() const sourceRect = sourceRef.current.getBoundingClientRect() - const targetRect = targetRef.current.getBoundingClientRect() const sourceX = sourceRect.right - containerRect.left const sourceY = sourceRect.top + sourceRect.height / 2 - containerRect.top - const targetX = targetRect.left - containerRect.left - const targetY = targetRect.top + targetRect.height / 2 - containerRect.top - const midX = (sourceX + targetX) / 2 - const controlY = Math.min(sourceY, targetY) - 20 - - // Create a smooth curved path with a quadratic bezier for a U-shape - const path = `M ${sourceX} ${sourceY} Q ${midX} ${controlY}, ${targetX} ${targetY}` - - setPathData(path) + setLineStart({ x: sourceX, y: sourceY }) } // Small delay to ensure layout is ready @@ -94,9 +86,10 @@ const SchemaFlowDiagram = ({ }, [dotColor]) return ( + // Outer container
@@ -119,15 +112,20 @@ const SchemaFlowDiagram = ({ aria-label={`Source: ${sourceLabel} ${sourceType} schema`} > - {/* SVG Path for Curved Dashed Line */} - {pathData && ( + {/* SVG Path for Straight Dashed Line */} + {lineStart && ( )} {/* Target Node */}
+ {/* Icon */}
-
-

+ {/* Text */} +

+

{targetLabel}

-

- Postgres schema{isPending && ' that will be created'} +

+ Analytics schema{isPending && ' that will be created'}