mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Add Sonner
This commit is contained in:
parent
13390719a5
commit
250307689b
7 changed files with 53 additions and 7 deletions
|
|
@ -36,6 +36,7 @@
|
|||
"react-dom": "^19.0.0",
|
||||
"react-hook-form": "^7.54.2",
|
||||
"react-use": "^17.6.0",
|
||||
"sonner": "^2.0.2",
|
||||
"tailwind-merge": "^3.0.2",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"vaul": "^1.1.2",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import type { Metadata } from "next"
|
|||
import { Geist, Geist_Mono } from "next/font/google"
|
||||
|
||||
import { ThemeProvider, ReactQueryProvider } from "@/components/providers"
|
||||
import { Toaster } from "@/components/ui"
|
||||
import { Header } from "@/components/layout/header"
|
||||
|
||||
import "./globals.css"
|
||||
|
|
@ -27,6 +28,7 @@ export default function RootLayout({
|
|||
{children}
|
||||
</ReactQueryProvider>
|
||||
</ThemeProvider>
|
||||
<Toaster />
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
"use client"
|
||||
|
||||
import { Fragment, useCallback, useRef, useState } from "react"
|
||||
import { useCallback, useRef, useState } from "react"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { z } from "zod"
|
||||
import { useForm, FormProvider } from "react-hook-form"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import fuzzysort from "fuzzysort"
|
||||
import { toast } from "sonner"
|
||||
import { X, Rocket, Check, ChevronsUpDown, HardDriveUpload, CircleCheck } from "lucide-react"
|
||||
|
||||
import { ExperimentId, Experiments, globalSettingsSchema, rooCodeDefaults } from "@benchmark/types"
|
||||
import { globalSettingsSchema, rooCodeDefaults } from "@benchmark/types"
|
||||
|
||||
import { createRun } from "@/lib/server/runs"
|
||||
import { createRunSchema as formSchema, type CreateRun as FormValues } from "@/lib/schemas"
|
||||
|
|
@ -38,7 +40,7 @@ import {
|
|||
PopoverTrigger,
|
||||
ScrollArea,
|
||||
} from "@/components/ui"
|
||||
import { z } from "zod"
|
||||
|
||||
import { SettingsDiff } from "./settings-diff"
|
||||
|
||||
const recommendedModels = [
|
||||
|
|
@ -84,8 +86,8 @@ export function NewRun() {
|
|||
try {
|
||||
const { id } = await createRun(data)
|
||||
router.push(`/runs/${id}`)
|
||||
} catch (_e) {
|
||||
// Surface error.
|
||||
} catch (e) {
|
||||
toast.error(e instanceof Error ? e.message : "An unknown error occurred.")
|
||||
}
|
||||
},
|
||||
[router],
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export * from "./popover"
|
|||
export * from "./scroll-area"
|
||||
export * from "./select"
|
||||
export * from "./separator"
|
||||
export * from "./sonner"
|
||||
export * from "./table"
|
||||
export * from "./tabs"
|
||||
export * from "./textarea"
|
||||
|
|
|
|||
25
benchmark/apps/web/src/components/ui/sonner.tsx
Normal file
25
benchmark/apps/web/src/components/ui/sonner.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
"use client"
|
||||
|
||||
import { useTheme } from "next-themes"
|
||||
import { Toaster as Sonner, ToasterProps } from "sonner"
|
||||
|
||||
const Toaster = ({ ...props }: ToasterProps) => {
|
||||
const { theme = "system" } = useTheme()
|
||||
|
||||
return (
|
||||
<Sonner
|
||||
theme={theme as ToasterProps["theme"]}
|
||||
className="toaster group"
|
||||
style={
|
||||
{
|
||||
"--normal-bg": "var(--popover)",
|
||||
"--normal-text": "var(--popover-foreground)",
|
||||
"--normal-border": "var(--border)",
|
||||
} as React.CSSProperties
|
||||
}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export { Toaster }
|
||||
|
|
@ -27,8 +27,8 @@ export const runsRelations = relations(runs, ({ one }) => ({
|
|||
|
||||
export type Run = typeof runs.$inferSelect
|
||||
|
||||
export const insertRunSchema = createInsertSchema(runs).omit({ id: true, createdAt: true, settings: true }).extend({
|
||||
settings: globalSettingsSchema,
|
||||
export const insertRunSchema = createInsertSchema(runs).omit({ id: true, createdAt: true }).extend({
|
||||
settings: globalSettingsSchema.optional(),
|
||||
})
|
||||
|
||||
export type InsertRun = Omit<typeof runs.$inferInsert, "id" | "createdAt">
|
||||
|
|
|
|||
15
benchmark/pnpm-lock.yaml
generated
15
benchmark/pnpm-lock.yaml
generated
|
|
@ -150,6 +150,9 @@ importers:
|
|||
react-use:
|
||||
specifier: ^17.6.0
|
||||
version: 17.6.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||
sonner:
|
||||
specifier: ^2.0.2
|
||||
version: 2.0.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||
tailwind-merge:
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
|
|
@ -2961,6 +2964,7 @@ packages:
|
|||
|
||||
libsql@0.4.7:
|
||||
resolution: {integrity: sha512-T9eIRCs6b0J1SHKYIvD8+KCJMcWZ900iZyxdnSCdqxN12Z1ijzT+jY5nrk72Jw4B0HGzms2NgpryArlJqvc3Lw==}
|
||||
cpu: [x64, arm64, wasm32]
|
||||
os: [darwin, linux, win32]
|
||||
|
||||
lie@3.3.0:
|
||||
|
|
@ -3677,6 +3681,12 @@ packages:
|
|||
simple-swizzle@0.2.2:
|
||||
resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==}
|
||||
|
||||
sonner@2.0.2:
|
||||
resolution: {integrity: sha512-xOeXErZ4blqQd11ZnlDmoRmg+ctUJBkTU8H+HVh9rnWi9Ke28xiL39r4iCTeDX31ODTe/s1MaiaY333dUzLCtA==}
|
||||
peerDependencies:
|
||||
react: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
|
||||
react-dom: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
|
||||
|
||||
source-map-js@1.2.1:
|
||||
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
|
@ -7485,6 +7495,11 @@ snapshots:
|
|||
is-arrayish: 0.3.2
|
||||
optional: true
|
||||
|
||||
sonner@2.0.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0):
|
||||
dependencies:
|
||||
react: 19.0.0
|
||||
react-dom: 19.0.0(react@19.0.0)
|
||||
|
||||
source-map-js@1.2.1: {}
|
||||
|
||||
source-map-support@0.5.21:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue