Support multi select logs and add CTA (#45974)

## Context

Supports selecting log rows and allow to copy / ask assistant for
selected rows, similar to what we had for the old logs UI
Selection will clear whenever the search parameters change

<img width="1448" height="413" alt="image"
src="https://github.com/user-attachments/assets/b81b359c-28c3-48a8-9895-e77327ebd33e"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Multi-row selection with an action header showing selected count
  * Copy selected logs as JSON or Markdown from a dropdown
* "Explain with AI" action to open the assistant pre-filled with
selected logs
  * Clear selection button

* **Refactor**
* Row/detail selection now syncs with the URL for shareable views and
improves next/previous navigation and panel behavior

* **Style**
  * Minor visual tweak to column level indicator dot size

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45974)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Joshen Lim
2026-05-20 20:03:52 +07:00
committed by GitHub
parent 394ccf4e27
commit 84484be46d
13 changed files with 262 additions and 148 deletions

View File

@@ -1,8 +1,6 @@
import { Minus } from 'lucide-react'
import { cn } from 'ui'
import { getStatusColor } from '../DataTable.utils'
export const DataTableColumnStatusCode = ({
value,
level,
@@ -12,21 +10,35 @@ export const DataTableColumnStatusCode = ({
level?: string
className?: string
}) => {
const colors = getStatusColor(level)
const colorClassName = getStatusColor(level)
function getStatusColor(value?: number | string): string {
switch (value) {
case '1':
case 'info':
return 'text-blue-500'
case '2':
case 'success':
return 'text-foreground'
case '4':
case 'warning':
case 'redirect':
return 'text-warning'
case '5':
case 'error':
return 'text-destructive'
default:
return 'text-foreground'
}
}
if (!value) {
return <Minus className="h-4 w-4 text-muted-foreground/50" />
}
return (
<div className={cn('flex items-center relative', className)}>
<div
className={cn(
'flex items-center justify-center relative font-mono',
colors.text,
colors.bg,
colors.border
)}
>
<div className={cn('flex items-center justify-center relative font-mono', colorClassName)}>
{value}
</div>
</div>