🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Refactor PerformanceTable and organization member page for improved UI consistency
Bill Yangaf5983214612
diff --git a/client/src/app/[site]/performance/components/PerformanceTable.tsx b/client/src/app/[site]/performance/components/PerformanceTable.tsxindex e2421d7ba..275977ca9 100644--- a/client/src/app/[site]/performance/components/PerformanceTable.tsx+++ b/client/src/app/[site]/performance/components/PerformanceTable.tsx@@ -184,7 +184,7 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {onClick={e => e.stopPropagation()}><SquareArrowOutUpRight- className="ml-0.5 w-3.5 h-3.5 text-neutral-600 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100"+ className="w-3.5 h-3.5 text-neutral-600 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100"strokeWidth={3}/></a>@@ -197,72 +197,54 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {}),columnHelper.accessor(`lcp_${selectedPercentile}`, {header: () => (- <div className="flex items-center justify-center gap-1">+ <div className="flex items-center gap-1">LCP<MetricTooltip metric="lcp" /></div>),- cell: info => (- <div className="text-center">- <MetricCell metric="lcp" value={info.getValue() as number} percentile={selectedPercentile} />- </div>- ),+ cell: info => <MetricCell metric="lcp" value={info.getValue() as number} percentile={selectedPercentile} />,}),columnHelper.accessor(`cls_${selectedPercentile}`, {header: () => (- <div className="flex items-center justify-center gap-1">+ <div className="flex items-center gap-1">CLS<MetricTooltip metric="cls" /></div>),- cell: info => (- <div className="text-center">- <MetricCell metric="cls" value={info.getValue() as number} percentile={selectedPercentile} />- </div>- ),+ cell: info => <MetricCell metric="cls" value={info.getValue() as number} percentile={selectedPercentile} />,}),columnHelper.accessor(`inp_${selectedPercentile}`, {header: () => (- <div className="flex items-center justify-center gap-1">+ <div className="flex items-center gap-1">INP<MetricTooltip metric="inp" /></div>),- cell: info => (- <div className="text-center">- <MetricCell metric="inp" value={info.getValue() as number} percentile={selectedPercentile} />- </div>- ),+ cell: info => <MetricCell metric="inp" value={info.getValue() as number} percentile={selectedPercentile} />,}),columnHelper.accessor(`fcp_${selectedPercentile}`, {header: () => (- <div className="flex items-center justify-center gap-1">+ <div className="flex items-center gap-1">FCP<MetricTooltip metric="fcp" /></div>),- cell: info => (- <div className="text-center">- <MetricCell metric="fcp" value={info.getValue() as number} percentile={selectedPercentile} />- </div>- ),+ cell: info => <MetricCell metric="fcp" value={info.getValue() as number} percentile={selectedPercentile} />,}),columnHelper.accessor(`ttfb_${selectedPercentile}`, {header: () => (- <div className="flex items-center justify-center gap-1">+ <div className="flex items-center gap-1">TTFB<MetricTooltip metric="ttfb" /></div>),- cell: info => (- <div className="text-center">- <MetricCell metric="ttfb" value={info.getValue() as number} percentile={selectedPercentile} />- </div>- ),+ cell: info => <MetricCell metric="ttfb" value={info.getValue() as number} percentile={selectedPercentile} />,}),columnHelper.accessor("event_count", {header: "Events",- cell: info => <div className="text-center text-neutral-600 dark:text-neutral-300">{info.getValue()?.toLocaleString() ?? 0}</div>,+ cell: info => (+ <div className="text-neutral-600 dark:text-neutral-300">{info.getValue()?.toLocaleString() ?? 0}</div>+ ),}),],[selectedPercentile]@@ -347,7 +329,7 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {</TableHeader><TableBody>{Array.from({ length: 10 }).map((_, i) => (- <TableRow key={i} className="border-neutral-300 dark:border-neutral-800">+ <TableRow key={i}><TableCell><div className="flex items-center gap-2"><Skeleton className="h-4 w-4 rounded" />@@ -355,32 +337,32 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {</div></TableCell><TableCell>- <div className="text-center">+ <div><Skeleton className="h-4 w-12 mx-auto" /></div></TableCell><TableCell>- <div className="text-center">+ <div><Skeleton className="h-4 w-10 mx-auto" /></div></TableCell><TableCell>- <div className="text-center">+ <div><Skeleton className="h-4 w-12 mx-auto" /></div></TableCell><TableCell>- <div className="text-center">+ <div><Skeleton className="h-4 w-12 mx-auto" /></div></TableCell><TableCell>- <div className="text-center">+ <div><Skeleton className="h-4 w-12 mx-auto" /></div></TableCell><TableCell>- <div className="text-center">+ <div><Skeleton className="h-4 w-16 mx-auto" /></div></TableCell>@@ -393,7 +375,7 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {<Table><TableHeader>{table.getHeaderGroups().map(headerGroup => (- <TableRow key={headerGroup.id} className="border-neutral-300 dark:border-neutral-800">+ <TableRow key={headerGroup.id}>{headerGroup.headers.map(header => (<TableHeadkey={header.id}@@ -404,7 +386,7 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {}`}onClick={header.column.getToggleSortingHandler()}>- <div className="flex items-center justify-center gap-1">+ <div className="flex items-center gap-1">{flexRender(header.column.columnDef.header, header.getContext())}{header.column.getCanSort() && (<div className="flex flex-col">@@ -413,7 +395,7 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {) : header.column.getIsSorted() === "desc" ? (<ChevronDown className="h-3 w-3 text-blue-400" />) : (- <ChevronsUpDown className="h-3 w-3 text-neutral-600" />+ <ChevronsUpDown className="h-3 w-3 text-neutral-400" />)}</div>)}@@ -426,13 +408,13 @@ export function PerformanceTable({ dimension, title }: PerformanceTableProps) {<TableBody>{table.getRowModel().rows.length === 0 ? (<TableRow>- <TableCell colSpan={columns.length} className="text-center text-neutral-500 py-8">+ <TableCell colSpan={columns.length} className="text-neutral-500 py-8">No performance data available</TableCell></TableRow>) : (table.getRowModel().rows.map(row => (- <TableRow key={row.id} className="border-neutral-300 dark:border-neutral-800 hover:bg-neutral-100/50 dark:hover:bg-neutral-900/50">+ <TableRow key={row.id}>{row.getVisibleCells().map(cell => (<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>))}diff --git a/client/src/app/settings/organization/members/page.tsx b/client/src/app/settings/organization/members/page.tsxindex e777d0cfd..0e3b23f4c 100644--- a/client/src/app/settings/organization/members/page.tsx+++ b/client/src/app/settings/organization/members/page.tsx@@ -102,23 +102,26 @@ function Organization({return (<>- <Card>- <CardHeader>- <CardTitle className="text-xl">Organization</CardTitle>- </CardHeader>- <CardContent>- <div className="space-y-2">- <h4 className="text-sm font-medium">Organization Name</h4>- <p className="text-xs text-neutral-500">Update your organization name</p>- <div className="flex space-x-2">- <Input id="name" value={name} onChange={({ target }) => setName(target.value)} placeholder="name" />- <Button variant="outline" onClick={handleOrganizationNameUpdate} disabled={name === org.name}>- {isUpdating ? "Updating..." : "Update"}- </Button>+ {isOwner && (+ <Card>+ <CardHeader>+ <CardTitle className="text-xl">Organization</CardTitle>+ </CardHeader>+ <CardContent>+ <div className="space-y-2">+ <h4 className="text-sm font-medium">Organization Name</h4>+ <p className="text-xs text-neutral-500">Update your organization name</p>+ <div className="flex space-x-2">+ <Input id="name" value={name} onChange={({ target }) => setName(target.value)} placeholder="name" />+ <Button variant="outline" onClick={handleOrganizationNameUpdate} disabled={name === org.name}>+ {isUpdating ? "Updating..." : "Update"}+ </Button>+ </div></div>- </div>- </CardContent>- </Card>+ {/* <DeleteOrganizationDialog organization={org} onSuccess={handleRefresh} /> */}+ </CardContent>+ </Card>+ )}<Card className="w-full"><CardHeader className="pb-2"><div className="flex items-center justify-between flex-wrap gap-2">@@ -137,7 +140,6 @@ function Organization({<CreateUserDialog organizationId={org.id} onSuccess={handleRefresh} />)}<EditOrganizationDialog organization={org} onSuccess={handleRefresh} />- <DeleteOrganizationDialog organization={org} onSuccess={handleRefresh} /></>)}</div>diff --git a/client/src/components/ui/table.tsx b/client/src/components/ui/table.tsxindex 84c0e0288..2677632c6 100644--- a/client/src/components/ui/table.tsx+++ b/client/src/components/ui/table.tsx@@ -29,7 +29,7 @@ const TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttribut({ className, ...props }, ref) => (<tfootref={ref}- className={cn("border-t bg-neutral-100/50 font-medium [&>tr]:last:border-b-0 dark:bg-neutral-800/50", className)}+ className={cn("border-t bg-neutral-100/50 font-normal [&>tr]:last:border-b-0 dark:bg-neutral-800/50", className)}{...props}/>)@@ -41,7 +41,7 @@ const TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTML<trref={ref}className={cn(- "border-b border-b-neutral-100 transition-colors hover:bg-neutral-100/50 data-[state=selected]:bg-neutral-100 dark:border-b-neutral-800 dark:hover:bg-neutral-800/50 dark:data-[state=selected]:bg-neutral-800",+ "border-b border-b-neutral-100 transition-colors hover:bg-neutral-100/50 data-[state=selected]:bg-neutral-100 dark:border-b-neutral-800 dark:hover:bg-neutral-800/20 dark:data-[state=selected]:bg-neutral-800",className)}{...props}