From 48f165c16c10fe1f3e1cf7595212eed7c290e053 Mon Sep 17 00:00:00 2001 From: kvtodev Date: Wed, 8 Jul 2026 10:52:37 +0800 Subject: [PATCH] Refactor: move editor agent hook --- .../EditorAgentConversationPanelView.test.tsx | 2 +- .../useEditorAgentConversation.test.tsx | 2 +- .../useEditorAgentConversation.ts | 4 ++-- src/components/image-editor/ImageCanvasEditorView.test.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename src/components/image-editor/{ => EditorAgentConversation}/useEditorAgentConversation.test.tsx (99%) rename src/components/image-editor/{ => EditorAgentConversation}/useEditorAgentConversation.ts (99%) diff --git a/src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.test.tsx b/src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.test.tsx index b8a5d0033..b3326b4cb 100644 --- a/src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.test.tsx +++ b/src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.test.tsx @@ -10,7 +10,7 @@ import { } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { EditorAgentConversationClient } from '@/src/components/image-editor/useEditorAgentConversation.ts'; +import type { EditorAgentConversationClient } from '@/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts'; import { useImageCanvasContextStore } from '@/src/components/image-editor/useImageCanvasContextStore.ts'; import { EditorAgentConversationPanelView } from './EditorAgentConversationPanelView.tsx'; diff --git a/src/components/image-editor/useEditorAgentConversation.test.tsx b/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.test.tsx similarity index 99% rename from src/components/image-editor/useEditorAgentConversation.test.tsx rename to src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.test.tsx index 32a8abe36..69a32a8a7 100644 --- a/src/components/image-editor/useEditorAgentConversation.test.tsx +++ b/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.test.tsx @@ -6,7 +6,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { type EditorAgentConversationClient, useEditorAgentConversation, -} from './useEditorAgentConversation'; +} from './useEditorAgentConversation.ts'; function createClient(): EditorAgentConversationClient { return { diff --git a/src/components/image-editor/useEditorAgentConversation.ts b/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts similarity index 99% rename from src/components/image-editor/useEditorAgentConversation.ts rename to src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts index 76401dfff..7cc68bcb3 100644 --- a/src/components/image-editor/useEditorAgentConversation.ts +++ b/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts @@ -11,7 +11,7 @@ import type { EditorAgentSseEvent, EditorAgentStage, StreamEditorAgentMessageRequest, -} from '../../../packages/shared/src/contracts/editorAgent'; +} from '../../../../packages/shared/src/contracts/editorAgent.ts'; import { createEditorAgentConversation, deleteEditorAgentConversation, @@ -19,7 +19,7 @@ import { listEditorAgentConversations, streamEditorAgentMessage, type StreamEditorAgentMessageOptions, -} from '../../services/image-editor/editorAgentClient'; +} from '../../../services/image-editor/editorAgentClient.ts'; export type EditorAgentConversationClient = { listConversations: ( diff --git a/src/components/image-editor/ImageCanvasEditorView.test.tsx b/src/components/image-editor/ImageCanvasEditorView.test.tsx index 7387b70c8..de156fb2b 100644 --- a/src/components/image-editor/ImageCanvasEditorView.test.tsx +++ b/src/components/image-editor/ImageCanvasEditorView.test.tsx @@ -12,7 +12,7 @@ import userEvent from '@testing-library/user-event'; import JSZip from 'jszip'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { EditorAgentConversationClient } from './useEditorAgentConversation'; +import type { EditorAgentConversationClient } from './EditorAgentConversation/useEditorAgentConversation.ts'; import { ApiClientError, AuthUiContext,