Skip to content

An AI-powered search engine with a generative UI

refactor: rename artifact UI components to inspector for better domain separation

Yoshiki Miura8252650585bd
diff --git a/components/artifact/chat-artifact-container.tsx b/components/artifact/chat-artifact-container.tsx
index 19fa025a..afa8f83d 100644
--- a/components/artifact/chat-artifact-container.tsx
+++ b/components/artifact/chat-artifact-container.tsx
@@ -1,5 +1,7 @@
'use client'
+import { InspectorDrawer } from '@/components/inspector/inspector-drawer'
+import { InspectorPanel } from '@/components/inspector/inspector-panel'
import {
ResizableHandle,
ResizablePanel,
@@ -9,8 +11,6 @@ import { useMediaQuery } from '@/lib/hooks/use-media-query'
import { cn } from '@/lib/utils'
import React, { useEffect, useState } from 'react'
import { useArtifact } from './artifact-context'
-import { ArtifactDrawer } from './artifact-drawer'
-import { ArtifactPanel } from './artifact-panel'
export function ChatArtifactContainer({
children
@@ -57,7 +57,7 @@ export function ChatArtifactContainer({
minSize={30}
defaultSize={40}
>
- <ArtifactPanel />
+ <InspectorPanel />
</ResizablePanel>
</>
)}
@@ -71,7 +71,7 @@ export function ChatArtifactContainer({
{/* Responsive classes removed */}
{children}
{/* ArtifactDrawer checks isMobile internally, no double check needed */}
- <ArtifactDrawer />
+ <InspectorDrawer />
</div>
)}
</div>
diff --git a/components/artifact/artifact-drawer.tsx b/components/inspector/inspector-drawer.tsx
similarity index 85%
rename from components/artifact/artifact-drawer.tsx
rename to components/inspector/inspector-drawer.tsx
index 9a3ee5f5..0834506f 100644
--- a/components/artifact/artifact-drawer.tsx
+++ b/components/inspector/inspector-drawer.tsx
@@ -1,12 +1,12 @@
'use client'
+import { useArtifact } from '@/components/artifact/artifact-context'
import { Drawer, DrawerContent, DrawerTitle } from '@/components/ui/drawer'
import { useMediaQuery } from '@/lib/hooks/use-media-query'
import { VisuallyHidden } from '@radix-ui/react-visually-hidden'
-import { useArtifact } from './artifact-context'
-import { ArtifactPanel } from './artifact-panel'
+import { InspectorPanel } from './inspector-panel'
-export function ArtifactDrawer() {
+export function InspectorDrawer() {
const { state, close } = useArtifact()
const part = state.part
const isMobile = useMediaQuery('(max-width: 767px)')
@@ -40,7 +40,7 @@ export function ArtifactDrawer() {
<DrawerTitle asChild>
<VisuallyHidden>{getTitle()}</VisuallyHidden>
</DrawerTitle>
- <ArtifactPanel />
+ <InspectorPanel />
</DrawerContent>
</Drawer>
)
diff --git a/components/artifact/artifact-panel.tsx b/components/inspector/inspector-panel.tsx
similarity index 92%
rename from components/artifact/artifact-panel.tsx
rename to components/inspector/inspector-panel.tsx
index 3f63eead..9856eeaa 100644
--- a/components/artifact/artifact-panel.tsx
+++ b/components/inspector/inspector-panel.tsx
@@ -1,5 +1,7 @@
'use client'
+import { ArtifactContent } from '@/components/artifact/artifact-content'
+import { useArtifact } from '@/components/artifact/artifact-context'
import { Button } from '@/components/ui/button'
import { Separator } from '@/components/ui/separator'
import {
@@ -9,10 +11,8 @@ import {
TooltipTrigger
} from '@/components/ui/tooltip'
import { LightbulbIcon, MessageSquare, Minimize2, Wrench } from 'lucide-react'
-import { ArtifactContent } from './artifact-content'
-import { useArtifact } from './artifact-context'
-export function ArtifactPanel() {
+export function InspectorPanel() {
const { state, close } = useArtifact()
const part = state.part
if (!part) return null