Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/admin/_components/admin-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
Settings,
} from 'lucide-react'

type NavItem = {
interface NavItem {
title: string
href: Route
icon: React.ComponentType<{ className?: string }>
Expand Down
3 changes: 2 additions & 1 deletion app/api/contact/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from 'next/server'
import type { NextRequest} from 'next/server';
import { NextResponse } from 'next/server'

interface ContactFormData {
firstName: string
Expand Down
21 changes: 12 additions & 9 deletions app/chat/components/agent-artifact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type { ArtifactData } from './chat.types'
interface AgentArtifactProps {
artifact: ArtifactData
onClose?: () => void
// eslint-disable-next-line no-unused-vars

onCodeUpdate?: (artifactId: string, newCode: string) => void
}

Expand Down Expand Up @@ -59,14 +59,17 @@ export function AgentArtifact({
artifact.type === 'code' &&
PREVIEWABLE_LANGUAGES.includes(normalizeLanguage(artifact.language))

const handleCopy = useCallback(async () => {
try {
await navigator.clipboard.writeText(editedCode)
setCopied(true)
setTimeout(() => setCopied(false), 2000)
} catch (err) {
void err
const handleCopy = useCallback(() => {
const doCopy = async () => {
try {
await navigator.clipboard.writeText(editedCode)
setCopied(true)
setTimeout(() => setCopied(false), 2000)
} catch (err) {
void err
}
}
void doCopy()
Comment on lines +62 to +72
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The async wrapper function pattern is overly complex. Instead of wrapping handleCopy in a nested async function (doCopy), keep the original async/await pattern and use 'void handleCopy()' at the call site. This maintains cleaner code structure while still satisfying the floating promise constraint.

Copilot generated this review using guidance from repository custom instructions.
}, [editedCode])
Comment on lines +62 to 73
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Fire-and-forget pattern is correct, but error is silently swallowed.

The async IIFE pattern correctly handles the clipboard operation without returning a Promise. However, void err silently discards any clipboard errors without logging or user feedback, making debugging difficult if copy operations fail.

♻️ Suggested: Log clipboard errors for debugging
     const handleCopy = useCallback(() => {
         const doCopy = async () => {
             try {
                 await navigator.clipboard.writeText(editedCode)
                 setCopied(true)
                 setTimeout(() => setCopied(false), 2000)
             } catch (err) {
-                void err
+                console.error('Failed to copy to clipboard:', err)
             }
         }
         void doCopy()
     }, [editedCode])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleCopy = useCallback(() => {
const doCopy = async () => {
try {
await navigator.clipboard.writeText(editedCode)
setCopied(true)
setTimeout(() => setCopied(false), 2000)
} catch (err) {
void err
}
}
void doCopy()
}, [editedCode])
const handleCopy = useCallback(() => {
const doCopy = async () => {
try {
await navigator.clipboard.writeText(editedCode)
setCopied(true)
setTimeout(() => setCopied(false), 2000)
} catch (err) {
console.error('Failed to copy to clipboard:', err)
}
}
void doCopy()
}, [editedCode])
🤖 Prompt for AI Agents
In `@app/chat/components/agent-artifact.tsx` around lines 62 - 73, The clipboard
error is being swallowed in handleCopy's doCopy catch block; change the catch to
log the error (e.g., console.error) and optionally surface user feedback (e.g.,
set an error state or trigger a toast) so failures are visible; update the catch
in the doCopy async function inside handleCopy to log err and handle
user-visible error behavior while keeping the fire-and-forget pattern and
existing setCopied logic.


const handleDownload = useCallback(() => {
Expand Down Expand Up @@ -233,7 +236,7 @@ export function AgentArtifactCompact({
// Floating action button for quick access to editor
interface ArtifactEditorFABProps {
artifact: ArtifactData
// eslint-disable-next-line no-unused-vars

onCodeChange?: (newCode: string) => void
}

Expand Down
6 changes: 2 additions & 4 deletions app/chat/components/agent-confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ interface AgentConfirmationProps {
state: ToolUIPart['state']
severity?: ConfirmationSeverity
className?: string
// eslint-disable-next-line no-unused-vars
onApprove(approvalId: string): void
// eslint-disable-next-line no-unused-vars
onReject(approvalId: string): void
onApprove: (approvalId: string) => void
onReject: (approvalId: string) => void
}

const severityConfig: Record<
Expand Down
8 changes: 4 additions & 4 deletions app/chat/components/agent-web-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
CheckIcon,
PlayIcon,
RotateCcwIcon,
// eslint-disable-next-line no-unused-vars

Edit3Icon,
EyeIcon,
SplitIcon,
Expand All @@ -54,7 +54,7 @@ type PreviewStatus = 'idle' | 'running' | 'success' | 'error'
interface AgentWebPreviewProps {
preview: WebPreviewData
onClose?: () => void
// eslint-disable-next-line no-unused-vars

onCodeChange?: (code: string) => void
defaultTab?: 'preview' | 'code'
height?: string | number
Expand Down Expand Up @@ -444,7 +444,7 @@ export function AgentWebPreview({
variant="ghost"
size="sm"
className="h-6 gap-1 px-2 text-xs"
onClick={handleCopy}
onClick={() => void handleCopy()}
>
{copied ? (
<>
Expand Down Expand Up @@ -786,7 +786,7 @@ interface AgentCodeSandboxProps {
title?: string
dependencies?: Record<string, string>
onClose?: () => void
// eslint-disable-next-line no-unused-vars

onCodeChange?: (code: string) => void
editable?: boolean
}
Expand Down
Loading
Loading