mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-05 08:06:19 +00:00
Nova mobile pass - viewport: viewportFit cover for iOS safe-area-inset - safe-area utilities (pb-safe, pt-safe, bottom-safe-5, scroll-fade-x) in globals.css - chat FAB pinned above iPhone home indicator; chat sidebar widths responsive across sm/md/lg with min() clamps - chat input CoT panel max-h capped via min(60dvh, 420px) - header tab strip swapped from visible scrollbar to scroll-fade-x mask + snap-x - nova empty state uses svh on mobile, dvh from sm up Add-memory modal rebuilt for mobile - mobile shell switched from fullscreen Dialog to vaul Drawer at 85svh with swipe-down dismissal and scaled background - in-modal header removed; tabs moved to the bottom of the sheet for thumb reach - four tab compactLabels: Note, Links, Files, Connections - desktop tabs now render only when !isMobile (no DOM duplication) - note/link content state lifted to parent so switching tabs preserves typed input - NoteContent snapshots initialContent via lazy useState so the editor isn't reset on every keystroke - shared Drawer base uses rounded-t-xl - removed legacy pt-4 on tab content for mobile Connections — replace expiresAt with sync-run health - new useConnectionHealth hook reads the latest sync run and matches auth-failure patterns; backend errorKind field still needed (TODO) - regex tightened so 401/403 require co-occurring auth/token/grant context; refresh_token requires expired/revoked/invalid/missing qualifier - badge label changed Disconnected -> Needs reauth - Reconnect button replaces the sync action when needsReauth, kicks off the same OAuth flow - per-row reconnect tracking via mutation.variables instead of a single shared id (no race when multiple rows clicked) - fallback toast when authLink is missing so the spinner can't get stuck - sync history panel timeline capped at max-h-260 with internal scroll - useSyncRuns no longer refetches on mount; cache (30s) actually applies, cutting N requests per modal open
156 lines
3.6 KiB
TypeScript
156 lines
3.6 KiB
TypeScript
"use client"
|
|
|
|
import { cn } from "@lib/utils"
|
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
import { buttonVariants } from "@ui/components/button"
|
|
import type * as React from "react"
|
|
|
|
function AlertDialog({
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
}
|
|
|
|
function AlertDialogTrigger({
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
return (
|
|
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
)
|
|
}
|
|
|
|
function AlertDialogPortal({
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
return (
|
|
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
)
|
|
}
|
|
|
|
function AlertDialogOverlay({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
return (
|
|
<AlertDialogPrimitive.Overlay
|
|
className={cn(
|
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
className,
|
|
)}
|
|
data-slot="alert-dialog-overlay"
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function AlertDialogContent({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
|
return (
|
|
<AlertDialogPortal>
|
|
<AlertDialogOverlay />
|
|
<AlertDialogPrimitive.Content
|
|
className={cn(
|
|
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
className,
|
|
)}
|
|
data-slot="alert-dialog-content"
|
|
{...props}
|
|
/>
|
|
</AlertDialogPortal>
|
|
)
|
|
}
|
|
|
|
function AlertDialogHeader({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"div">) {
|
|
return (
|
|
<div
|
|
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
data-slot="alert-dialog-header"
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function AlertDialogFooter({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"div">) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
className,
|
|
)}
|
|
data-slot="alert-dialog-footer"
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function AlertDialogTitle({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
return (
|
|
<AlertDialogPrimitive.Title
|
|
className={cn("text-lg font-semibold", className)}
|
|
data-slot="alert-dialog-title"
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function AlertDialogDescription({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
return (
|
|
<AlertDialogPrimitive.Description
|
|
className={cn("text-muted-foreground text-sm", className)}
|
|
data-slot="alert-dialog-description"
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function AlertDialogAction({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
return (
|
|
<AlertDialogPrimitive.Action
|
|
className={cn(buttonVariants(), className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function AlertDialogCancel({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
return (
|
|
<AlertDialogPrimitive.Cancel
|
|
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export {
|
|
AlertDialog,
|
|
AlertDialogPortal,
|
|
AlertDialogOverlay,
|
|
AlertDialogTrigger,
|
|
AlertDialogContent,
|
|
AlertDialogHeader,
|
|
AlertDialogFooter,
|
|
AlertDialogTitle,
|
|
AlertDialogDescription,
|
|
AlertDialogAction,
|
|
AlertDialogCancel,
|
|
}
|