Skip to content
Closed
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()
}, [editedCode])
Comment on lines +62 to 73
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.

This refactored async pattern introduces unnecessary complexity by wrapping the async logic in an inner function. The original async callback pattern was cleaner and more idiomatic. The void operator on line 72 makes the fire-and-forget intention clear, but the extra wrapper function reduces readability. Consider keeping the original async callback if fire-and-forget is acceptable, or properly handling the promise if error handling is important.

Copilot generated this review using guidance from repository custom instructions.
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.

⚠️ Potential issue | 🟡 Minor

Inconsistent error handling compared to similar copy logic elsewhere.

The error is silently discarded with void err (Line 69), but in agent-web-preview.tsx (Line 155-157), the same copy operation logs the error with console.error('Failed to copy:', err). Consider logging the error for debugging consistency.

Proposed fix
     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:', err)
             }
         }
         void doCopy()
     }, [editedCode])
🤖 Prompt for AI Agents
In `@app/chat/components/agent-artifact.tsx` around lines 62 - 73, The handleCopy
handler currently swallows clipboard errors (in doCopy's catch it does "void
err"); update the catch to log the error like the other component to aid
debugging — inside the doCopy catch block for
navigator.clipboard.writeText(editedCode) replace the silent discard with a
console.error('Failed to copy:', err) (or the project's logger if preferred) and
keep the existing setCopied/setTimeout behavior unchanged; reference handleCopy
and the inner doCopy async function to locate the change.


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