From 58340b3ef9e6e5b04239a659c16de4a78f085a3a Mon Sep 17 00:00:00 2001 From: Hiep Le <69354317+hieptl@users.noreply.github.com> Date: Fri, 19 Dec 2025 21:12:38 +0700 Subject: [PATCH] refactor(frontend): consolidate state stores into stores directory (#12100) --- .../components/features/conversation/agent-status.test.tsx | 2 +- .../microagent-management/microagent-management.test.tsx | 2 +- frontend/__tests__/components/interactive-chat-box.test.tsx | 2 +- frontend/__tests__/components/terminal/terminal.test.tsx | 2 +- frontend/__tests__/conversation-websocket-handler.test.tsx | 2 +- frontend/__tests__/hooks/use-terminal.test.tsx | 2 +- frontend/__tests__/services/actions.test.ts | 4 ++-- frontend/__tests__/services/actions.test.tsx | 2 +- frontend/src/components/features/chat/change-agent-button.tsx | 2 +- frontend/src/components/features/chat/chat-interface.tsx | 2 +- frontend/src/components/features/chat/chat-suggestions.tsx | 2 +- .../features/chat/components/chat-input-container.tsx | 2 +- .../components/features/chat/components/chat-input-field.tsx | 2 +- frontend/src/components/features/chat/custom-chat-input.tsx | 2 +- .../src/components/features/chat/interactive-chat-box.tsx | 2 +- frontend/src/components/features/chat/uploaded-files.tsx | 2 +- frontend/src/components/features/controls/agent-status.tsx | 4 ++-- .../src/components/features/controls/git-tools-submenu.tsx | 2 +- frontend/src/components/features/controls/macros-submenu.tsx | 2 +- .../conversation/conversation-main/conversation-main.tsx | 2 +- .../conversation-tab-content/conversation-tab-content.tsx | 2 +- .../conversation/conversation-tabs/conversation-tabs.tsx | 2 +- .../microagent-management-add-microagent-button.tsx | 2 +- .../microagent-management/microagent-management-content.tsx | 2 +- .../microagent-management-conversation-stopped.tsx | 2 +- .../microagent-management/microagent-management-error.tsx | 2 +- .../microagent-management-learn-this-repo-modal.tsx | 2 +- .../microagent-management-learn-this-repo.tsx | 2 +- .../microagent-management/microagent-management-main.tsx | 2 +- .../microagent-management-microagent-card.tsx | 2 +- .../microagent-management-opening-pr.tsx | 2 +- .../microagent-management-repo-microagents.tsx | 2 +- .../microagent-management/microagent-management-review-pr.tsx | 2 +- .../microagent-management-sidebar-tabs.tsx | 2 +- .../microagent-management/microagent-management-sidebar.tsx | 2 +- .../microagent-management-upsert-microagent-modal.tsx | 2 +- .../microagent-management-view-microagent-content.tsx | 2 +- .../microagent-management-view-microagent-header.tsx | 2 +- .../microagent-management-view-microagent.tsx | 2 +- frontend/src/contexts/conversation-websocket-context.tsx | 4 ++-- frontend/src/hooks/chat/use-chat-input-logic.ts | 2 +- frontend/src/hooks/chat/use-grip-resize.ts | 2 +- frontend/src/hooks/use-auto-resize.ts | 2 +- frontend/src/hooks/use-handle-plan-click.ts | 2 +- frontend/src/hooks/use-terminal.ts | 2 +- frontend/src/routes/conversation.tsx | 4 ++-- frontend/src/routes/planner-tab.tsx | 2 +- frontend/src/services/actions.ts | 4 ++-- frontend/src/services/observations.ts | 2 +- frontend/src/{state => stores}/command-store.ts | 0 frontend/src/{state => stores}/conversation-store.ts | 0 frontend/src/{state => stores}/microagent-management-store.ts | 0 frontend/src/{state => stores}/status-store.ts | 0 53 files changed, 54 insertions(+), 54 deletions(-) rename frontend/src/{state => stores}/command-store.ts (100%) rename frontend/src/{state => stores}/conversation-store.ts (100%) rename frontend/src/{state => stores}/microagent-management-store.ts (100%) rename frontend/src/{state => stores}/status-store.ts (100%) diff --git a/frontend/__tests__/components/features/conversation/agent-status.test.tsx b/frontend/__tests__/components/features/conversation/agent-status.test.tsx index a121ed37a8..3bfb70be24 100644 --- a/frontend/__tests__/components/features/conversation/agent-status.test.tsx +++ b/frontend/__tests__/components/features/conversation/agent-status.test.tsx @@ -5,7 +5,7 @@ import { MemoryRouter } from "react-router"; import { AgentStatus } from "#/components/features/controls/agent-status"; import { AgentState } from "#/types/agent-state"; import { useAgentState } from "#/hooks/use-agent-state"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; vi.mock("#/hooks/use-agent-state"); diff --git a/frontend/__tests__/components/features/microagent-management/microagent-management.test.tsx b/frontend/__tests__/components/features/microagent-management/microagent-management.test.tsx index afdb8e84ba..b256fa14d9 100644 --- a/frontend/__tests__/components/features/microagent-management/microagent-management.test.tsx +++ b/frontend/__tests__/components/features/microagent-management/microagent-management.test.tsx @@ -12,7 +12,7 @@ import GitService from "#/api/git-service/git-service.api"; import { GitRepository } from "#/types/git"; import { RepositoryMicroagent } from "#/types/microagent-management"; import { Conversation } from "#/api/open-hands.types"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; // Mock hooks const mockUseUserProviders = vi.fn(); diff --git a/frontend/__tests__/components/interactive-chat-box.test.tsx b/frontend/__tests__/components/interactive-chat-box.test.tsx index 34ba1eaafd..cb164123c1 100644 --- a/frontend/__tests__/components/interactive-chat-box.test.tsx +++ b/frontend/__tests__/components/interactive-chat-box.test.tsx @@ -6,7 +6,7 @@ import { InteractiveChatBox } from "#/components/features/chat/interactive-chat- import { renderWithProviders } from "../../test-utils"; import { AgentState } from "#/types/agent-state"; import { useAgentState } from "#/hooks/use-agent-state"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; vi.mock("#/hooks/use-agent-state", () => ({ useAgentState: vi.fn(), diff --git a/frontend/__tests__/components/terminal/terminal.test.tsx b/frontend/__tests__/components/terminal/terminal.test.tsx index 15fb6357b2..ae25748a8b 100644 --- a/frontend/__tests__/components/terminal/terminal.test.tsx +++ b/frontend/__tests__/components/terminal/terminal.test.tsx @@ -1,7 +1,7 @@ import { act, screen } from "@testing-library/react"; import { renderWithProviders } from "test-utils"; import { vi, describe, afterEach, it, expect } from "vitest"; -import { Command, useCommandStore } from "#/state/command-store"; +import { Command, useCommandStore } from "#/stores/command-store"; import Terminal from "#/components/features/terminal/terminal"; const renderTerminal = (commands: Command[] = []) => { diff --git a/frontend/__tests__/conversation-websocket-handler.test.tsx b/frontend/__tests__/conversation-websocket-handler.test.tsx index f922a8876c..0a8050eca8 100644 --- a/frontend/__tests__/conversation-websocket-handler.test.tsx +++ b/frontend/__tests__/conversation-websocket-handler.test.tsx @@ -12,7 +12,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { http, HttpResponse } from "msw"; import { useOptimisticUserMessageStore } from "#/stores/optimistic-user-message-store"; import { useBrowserStore } from "#/stores/browser-store"; -import { useCommandStore } from "#/state/command-store"; +import { useCommandStore } from "#/stores/command-store"; import { createMockMessageEvent, createMockUserMessageEvent, diff --git a/frontend/__tests__/hooks/use-terminal.test.tsx b/frontend/__tests__/hooks/use-terminal.test.tsx index 08144503b5..62973f946a 100644 --- a/frontend/__tests__/hooks/use-terminal.test.tsx +++ b/frontend/__tests__/hooks/use-terminal.test.tsx @@ -1,7 +1,7 @@ /* eslint-disable max-classes-per-file */ import { beforeAll, describe, expect, it, vi, afterEach } from "vitest"; import { useTerminal } from "#/hooks/use-terminal"; -import { Command, useCommandStore } from "#/state/command-store"; +import { Command, useCommandStore } from "#/stores/command-store"; import { renderWithProviders } from "../../test-utils"; // Mock the WsClient context diff --git a/frontend/__tests__/services/actions.test.ts b/frontend/__tests__/services/actions.test.ts index 44700aef2c..8054b999d1 100644 --- a/frontend/__tests__/services/actions.test.ts +++ b/frontend/__tests__/services/actions.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; import { handleStatusMessage } from "#/services/actions"; import { StatusMessage } from "#/types/message"; import { queryClient } from "#/query-client-config"; -import { useStatusStore } from "#/state/status-store"; +import { useStatusStore } from "#/stores/status-store"; import { trackError } from "#/utils/error-handler"; // Mock dependencies @@ -12,7 +12,7 @@ vi.mock("#/query-client-config", () => ({ }, })); -vi.mock("#/state/status-store", () => ({ +vi.mock("#/stores/status-store", () => ({ useStatusStore: { getState: vi.fn(() => ({ setCurStatusMessage: vi.fn(), diff --git a/frontend/__tests__/services/actions.test.tsx b/frontend/__tests__/services/actions.test.tsx index c6e2ac76e2..555fd18caa 100644 --- a/frontend/__tests__/services/actions.test.tsx +++ b/frontend/__tests__/services/actions.test.tsx @@ -1,7 +1,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; import ActionType from "#/types/action-type"; import { ActionMessage } from "#/types/message"; -import { useCommandStore } from "#/state/command-store"; +import { useCommandStore } from "#/stores/command-store"; const mockDispatch = vi.fn(); const mockAppendInput = vi.fn(); diff --git a/frontend/src/components/features/chat/change-agent-button.tsx b/frontend/src/components/features/chat/change-agent-button.tsx index 68a0bd2699..28de891db9 100644 --- a/frontend/src/components/features/chat/change-agent-button.tsx +++ b/frontend/src/components/features/chat/change-agent-button.tsx @@ -5,7 +5,7 @@ import { I18nKey } from "#/i18n/declaration"; import CodeTagIcon from "#/icons/code-tag.svg?react"; import ChevronDownSmallIcon from "#/icons/chevron-down-small.svg?react"; import LessonPlanIcon from "#/icons/lesson-plan.svg?react"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { ChangeAgentContextMenu } from "./change-agent-context-menu"; import { cn } from "#/utils/utils"; import { USE_PLANNING_AGENT } from "#/utils/feature-flags"; diff --git a/frontend/src/components/features/chat/chat-interface.tsx b/frontend/src/components/features/chat/chat-interface.tsx index f37bd59c26..84c269dac3 100644 --- a/frontend/src/components/features/chat/chat-interface.tsx +++ b/frontend/src/components/features/chat/chat-interface.tsx @@ -38,7 +38,7 @@ import { import { useUnifiedUploadFiles } from "#/hooks/mutation/use-unified-upload-files"; import { useConfig } from "#/hooks/query/use-config"; import { validateFiles } from "#/utils/file-validation"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import ConfirmationModeEnabled from "./confirmation-mode-enabled"; import { isV0Event, diff --git a/frontend/src/components/features/chat/chat-suggestions.tsx b/frontend/src/components/features/chat/chat-suggestions.tsx index 8abc5aa41c..1f9a9345ad 100644 --- a/frontend/src/components/features/chat/chat-suggestions.tsx +++ b/frontend/src/components/features/chat/chat-suggestions.tsx @@ -4,7 +4,7 @@ import { Suggestions } from "#/components/features/suggestions/suggestions"; import { I18nKey } from "#/i18n/declaration"; import BuildIt from "#/icons/build-it.svg?react"; import { SUGGESTIONS } from "#/utils/suggestions"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; interface ChatSuggestionsProps { onSuggestionsClick: (value: string) => void; diff --git a/frontend/src/components/features/chat/components/chat-input-container.tsx b/frontend/src/components/features/chat/components/chat-input-container.tsx index acba3074f5..e950ce785b 100644 --- a/frontend/src/components/features/chat/components/chat-input-container.tsx +++ b/frontend/src/components/features/chat/components/chat-input-container.tsx @@ -3,7 +3,7 @@ import { DragOver } from "../drag-over"; import { UploadedFiles } from "../uploaded-files"; import { ChatInputRow } from "./chat-input-row"; import { ChatInputActions } from "./chat-input-actions"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { cn } from "#/utils/utils"; interface ChatInputContainerProps { diff --git a/frontend/src/components/features/chat/components/chat-input-field.tsx b/frontend/src/components/features/chat/components/chat-input-field.tsx index 4c52b7980b..7a6fe4f52b 100644 --- a/frontend/src/components/features/chat/components/chat-input-field.tsx +++ b/frontend/src/components/features/chat/components/chat-input-field.tsx @@ -1,7 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; interface ChatInputFieldProps { chatInputRef: React.RefObject; diff --git a/frontend/src/components/features/chat/custom-chat-input.tsx b/frontend/src/components/features/chat/custom-chat-input.tsx index 92ec264a34..624457b35b 100644 --- a/frontend/src/components/features/chat/custom-chat-input.tsx +++ b/frontend/src/components/features/chat/custom-chat-input.tsx @@ -8,7 +8,7 @@ import { useChatSubmission } from "#/hooks/chat/use-chat-submission"; import { ChatInputGrip } from "./components/chat-input-grip"; import { ChatInputContainer } from "./components/chat-input-container"; import { HiddenFileInput } from "./components/hidden-file-input"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; export interface CustomChatInputProps { disabled?: boolean; diff --git a/frontend/src/components/features/chat/interactive-chat-box.tsx b/frontend/src/components/features/chat/interactive-chat-box.tsx index 56a4def14d..a2f1df8348 100644 --- a/frontend/src/components/features/chat/interactive-chat-box.tsx +++ b/frontend/src/components/features/chat/interactive-chat-box.tsx @@ -5,7 +5,7 @@ import { CustomChatInput } from "./custom-chat-input"; import { AgentState } from "#/types/agent-state"; import { useActiveConversation } from "#/hooks/query/use-active-conversation"; import { GitControlBar } from "./git-control-bar"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { useAgentState } from "#/hooks/use-agent-state"; import { processFiles, processImages } from "#/utils/file-processing"; import { useSubConversationTaskPolling } from "#/hooks/query/use-sub-conversation-task-polling"; diff --git a/frontend/src/components/features/chat/uploaded-files.tsx b/frontend/src/components/features/chat/uploaded-files.tsx index 78b0c3dc49..ced7849ef0 100644 --- a/frontend/src/components/features/chat/uploaded-files.tsx +++ b/frontend/src/components/features/chat/uploaded-files.tsx @@ -1,6 +1,6 @@ import { UploadedFile } from "./uploaded-file"; import { UploadedImage } from "./uploaded-image"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; export function UploadedFiles() { const { diff --git a/frontend/src/components/features/controls/agent-status.tsx b/frontend/src/components/features/controls/agent-status.tsx index 675b5881a3..f62472bf95 100644 --- a/frontend/src/components/features/controls/agent-status.tsx +++ b/frontend/src/components/features/controls/agent-status.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; import { useEffect } from "react"; -import { useStatusStore } from "#/state/status-store"; +import { useStatusStore } from "#/stores/status-store"; import { useActiveConversation } from "#/hooks/query/use-active-conversation"; import { getStatusCode } from "#/utils/status"; import { ChatStopButton } from "../chat/chat-stop-button"; @@ -9,7 +9,7 @@ import ClockIcon from "#/icons/u-clock-three.svg?react"; import { ChatResumeAgentButton } from "../chat/chat-play-button"; import { cn, isTaskPolling } from "#/utils/utils"; import { AgentLoading } from "./agent-loading"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import CircleErrorIcon from "#/icons/circle-error.svg?react"; import { useAgentState } from "#/hooks/use-agent-state"; import { useUnifiedWebSocketStatus } from "#/hooks/use-unified-websocket-status"; diff --git a/frontend/src/components/features/controls/git-tools-submenu.tsx b/frontend/src/components/features/controls/git-tools-submenu.tsx index e55dd93952..97db554aba 100644 --- a/frontend/src/components/features/controls/git-tools-submenu.tsx +++ b/frontend/src/components/features/controls/git-tools-submenu.tsx @@ -10,7 +10,7 @@ import { getCreatePRPrompt, getCreateNewBranchPrompt, } from "#/utils/utils"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import ArrowUpIcon from "#/icons/u-arrow-up.svg?react"; import ArrowDownIcon from "#/icons/u-arrow-down.svg?react"; diff --git a/frontend/src/components/features/controls/macros-submenu.tsx b/frontend/src/components/features/controls/macros-submenu.tsx index 8705e11959..b167501d0b 100644 --- a/frontend/src/components/features/controls/macros-submenu.tsx +++ b/frontend/src/components/features/controls/macros-submenu.tsx @@ -8,7 +8,7 @@ import PrStatusIcon from "#/icons/pr-status.svg?react"; import DocumentIcon from "#/icons/document.svg?react"; import WaterIcon from "#/icons/u-water.svg?react"; import { I18nKey } from "#/i18n/declaration"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { REPO_SUGGESTIONS } from "#/utils/suggestions/repo-suggestions"; import { CONTEXT_MENU_ICON_TEXT_CLASSNAME } from "#/utils/constants"; diff --git a/frontend/src/components/features/conversation/conversation-main/conversation-main.tsx b/frontend/src/components/features/conversation/conversation-main/conversation-main.tsx index d5c7ad3a0e..0c6d639b3b 100644 --- a/frontend/src/components/features/conversation/conversation-main/conversation-main.tsx +++ b/frontend/src/components/features/conversation/conversation-main/conversation-main.tsx @@ -1,7 +1,7 @@ import { useWindowSize } from "@uidotdev/usehooks"; import { MobileLayout } from "./mobile-layout"; import { DesktopLayout } from "./desktop-layout"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; export function ConversationMain() { const { width } = useWindowSize(); diff --git a/frontend/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx b/frontend/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx index 39b68c9033..f9f2bef251 100644 --- a/frontend/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx +++ b/frontend/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx @@ -7,7 +7,7 @@ import { TabContainer } from "./tab-container"; import { TabContentArea } from "./tab-content-area"; import { ConversationTabTitle } from "../conversation-tab-title"; import Terminal from "#/components/features/terminal/terminal"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { useConversationId } from "#/hooks/use-conversation-id"; // Lazy load all tab components diff --git a/frontend/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx b/frontend/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx index eedb9010e8..ed649f373c 100644 --- a/frontend/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx +++ b/frontend/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx @@ -16,7 +16,7 @@ import { VSCodeTooltipContent } from "./vscode-tooltip-content"; import { useConversationStore, type ConversationTab, -} from "#/state/conversation-store"; +} from "#/stores/conversation-store"; import { ConversationTabsContextMenu } from "./conversation-tabs-context-menu"; import { USE_PLANNING_AGENT } from "#/utils/feature-flags"; import { useConversationId } from "#/hooks/use-conversation-id"; diff --git a/frontend/src/components/features/microagent-management/microagent-management-add-microagent-button.tsx b/frontend/src/components/features/microagent-management/microagent-management-add-microagent-button.tsx index 0fca5981c1..9bcb282ce8 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-add-microagent-button.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-add-microagent-button.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { GitRepository } from "#/types/git"; interface MicroagentManagementAddMicroagentButtonProps { diff --git a/frontend/src/components/features/microagent-management/microagent-management-content.tsx b/frontend/src/components/features/microagent-management/microagent-management-content.tsx index dc16e1da98..fe50ea7849 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-content.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-content.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; import { MicroagentManagementSidebar } from "./microagent-management-sidebar"; import { MicroagentManagementMain } from "./microagent-management-main"; import { MicroagentManagementUpsertMicroagentModal } from "./microagent-management-upsert-microagent-modal"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { useCreateConversationAndSubscribeMultiple } from "#/hooks/use-create-conversation-and-subscribe-multiple"; import { LearnThisRepoFormData, diff --git a/frontend/src/components/features/microagent-management/microagent-management-conversation-stopped.tsx b/frontend/src/components/features/microagent-management/microagent-management-conversation-stopped.tsx index 817c31f15f..6c1eb627fd 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-conversation-stopped.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-conversation-stopped.tsx @@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import { BrandButton } from "../settings/brand-button"; import { Loader } from "#/components/shared/loader"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; export function MicroagentManagementConversationStopped() { const { t } = useTranslation(); diff --git a/frontend/src/components/features/microagent-management/microagent-management-error.tsx b/frontend/src/components/features/microagent-management/microagent-management-error.tsx index 5918d6f081..022a718736 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-error.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-error.tsx @@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import { BrandButton } from "../settings/brand-button"; import { Loader } from "#/components/shared/loader"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; export function MicroagentManagementError() { const { t } = useTranslation(); diff --git a/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo-modal.tsx b/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo-modal.tsx index bbc46c8425..9bb1b40c6d 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo-modal.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo-modal.tsx @@ -5,7 +5,7 @@ import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalBody } from "#/components/shared/modals/modal-body"; import { BrandButton } from "../settings/brand-button"; import { I18nKey } from "#/i18n/declaration"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import XIcon from "#/icons/x.svg?react"; import { cn, getRepoMdCreatePrompt } from "#/utils/utils"; import { LearnThisRepoFormData } from "#/types/microagent-management"; diff --git a/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo.tsx b/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo.tsx index dbb76c162a..82d09f2936 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-learn-this-repo.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { GitRepository } from "#/types/git"; interface MicroagentManagementLearnThisRepoProps { diff --git a/frontend/src/components/features/microagent-management/microagent-management-main.tsx b/frontend/src/components/features/microagent-management/microagent-management-main.tsx index 6647d23121..c8405044f9 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-main.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-main.tsx @@ -1,4 +1,4 @@ -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { MicroagentManagementDefault } from "./microagent-management-default"; import { MicroagentManagementOpeningPr } from "./microagent-management-opening-pr"; import { MicroagentManagementReviewPr } from "./microagent-management-review-pr"; diff --git a/frontend/src/components/features/microagent-management/microagent-management-microagent-card.tsx b/frontend/src/components/features/microagent-management/microagent-management-microagent-card.tsx index 9da7f8383d..f8ac499f55 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-microagent-card.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-microagent-card.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import { RepositoryMicroagent } from "#/types/microagent-management"; import { Conversation } from "#/api/open-hands.types"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { cn } from "#/utils/utils"; import { GitRepository } from "#/types/git"; diff --git a/frontend/src/components/features/microagent-management/microagent-management-opening-pr.tsx b/frontend/src/components/features/microagent-management/microagent-management-opening-pr.tsx index f4a3beedc0..c9f3ad925d 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-opening-pr.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-opening-pr.tsx @@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import { BrandButton } from "../settings/brand-button"; import { Loader } from "#/components/shared/loader"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; export function MicroagentManagementOpeningPr() { const { t } = useTranslation(); diff --git a/frontend/src/components/features/microagent-management/microagent-management-repo-microagents.tsx b/frontend/src/components/features/microagent-management/microagent-management-repo-microagents.tsx index 868580550a..b2fc4464c0 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-repo-microagents.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-repo-microagents.tsx @@ -6,7 +6,7 @@ import { MicroagentManagementLearnThisRepo } from "./microagent-management-learn import { useRepositoryMicroagents } from "#/hooks/query/use-repository-microagents"; import { useMicroagentManagementConversations } from "#/hooks/query/use-microagent-management-conversations"; import { GitRepository } from "#/types/git"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { cn } from "#/utils/utils"; import { I18nKey } from "#/i18n/declaration"; diff --git a/frontend/src/components/features/microagent-management/microagent-management-review-pr.tsx b/frontend/src/components/features/microagent-management/microagent-management-review-pr.tsx index 1031b7202e..57f4ff129d 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-review-pr.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-review-pr.tsx @@ -3,7 +3,7 @@ import { I18nKey } from "#/i18n/declaration"; import { BrandButton } from "../settings/brand-button"; import { getProviderName, constructPullRequestUrl } from "#/utils/utils"; import { Provider } from "#/types/settings"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; export function MicroagentManagementReviewPr() { const { t } = useTranslation(); diff --git a/frontend/src/components/features/microagent-management/microagent-management-sidebar-tabs.tsx b/frontend/src/components/features/microagent-management/microagent-management-sidebar-tabs.tsx index 378f0ad7a1..d7a088c608 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-sidebar-tabs.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-sidebar-tabs.tsx @@ -2,7 +2,7 @@ import { Tab, Tabs } from "@heroui/react"; import { useTranslation } from "react-i18next"; import { MicroagentManagementRepositories } from "./microagent-management-repositories"; import { I18nKey } from "#/i18n/declaration"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; interface MicroagentManagementSidebarTabsProps { isSearchLoading?: boolean; diff --git a/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx b/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx index 3ef952bb79..99719a3f86 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-sidebar.tsx @@ -6,7 +6,7 @@ import { MicroagentManagementSidebarTabs } from "./microagent-management-sidebar import { useGitRepositories } from "#/hooks/query/use-git-repositories"; import { useSearchRepositories } from "#/hooks/query/use-search-repositories"; import { GitProviderDropdown } from "#/components/features/home/git-provider-dropdown"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { GitRepository } from "#/types/git"; import { Provider } from "#/types/settings"; import { diff --git a/frontend/src/components/features/microagent-management/microagent-management-upsert-microagent-modal.tsx b/frontend/src/components/features/microagent-management/microagent-management-upsert-microagent-modal.tsx index 6e41583f02..1c5bf37c80 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-upsert-microagent-modal.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-upsert-microagent-modal.tsx @@ -5,7 +5,7 @@ import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalBody } from "#/components/shared/modals/modal-body"; import { BrandButton } from "../settings/brand-button"; import { I18nKey } from "#/i18n/declaration"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import XIcon from "#/icons/x.svg?react"; import { cn, extractRepositoryInfo } from "#/utils/utils"; import { BadgeInput } from "#/components/shared/inputs/badge-input"; diff --git a/frontend/src/components/features/microagent-management/microagent-management-view-microagent-content.tsx b/frontend/src/components/features/microagent-management/microagent-management-view-microagent-content.tsx index 2994946731..d89ce2d199 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-view-microagent-content.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-view-microagent-content.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; import { Spinner } from "@heroui/react"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { useRepositoryMicroagentContent } from "#/hooks/query/use-repository-microagent-content"; import { I18nKey } from "#/i18n/declaration"; import { extractRepositoryInfo } from "#/utils/utils"; diff --git a/frontend/src/components/features/microagent-management/microagent-management-view-microagent-header.tsx b/frontend/src/components/features/microagent-management/microagent-management-view-microagent-header.tsx index bf28adbabe..a60f055adb 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-view-microagent-header.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-view-microagent-header.tsx @@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next"; import { BrandButton } from "../settings/brand-button"; import { getProviderName, constructMicroagentUrl } from "#/utils/utils"; import { I18nKey } from "#/i18n/declaration"; -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; export function MicroagentManagementViewMicroagentHeader() { const { t } = useTranslation(); diff --git a/frontend/src/components/features/microagent-management/microagent-management-view-microagent.tsx b/frontend/src/components/features/microagent-management/microagent-management-view-microagent.tsx index 2deaf1ef22..a7c6b6bdb8 100644 --- a/frontend/src/components/features/microagent-management/microagent-management-view-microagent.tsx +++ b/frontend/src/components/features/microagent-management/microagent-management-view-microagent.tsx @@ -1,4 +1,4 @@ -import { useMicroagentManagementStore } from "#/state/microagent-management-store"; +import { useMicroagentManagementStore } from "#/stores/microagent-management-store"; import { MicroagentManagementViewMicroagentHeader } from "./microagent-management-view-microagent-header"; import { MicroagentManagementViewMicroagentContent } from "./microagent-management-view-microagent-content"; diff --git a/frontend/src/contexts/conversation-websocket-context.tsx b/frontend/src/contexts/conversation-websocket-context.tsx index 0cf43b49ce..73bd2b365a 100644 --- a/frontend/src/contexts/conversation-websocket-context.tsx +++ b/frontend/src/contexts/conversation-websocket-context.tsx @@ -14,7 +14,7 @@ import { useEventStore } from "#/stores/use-event-store"; import { useErrorMessageStore } from "#/stores/error-message-store"; import { useOptimisticUserMessageStore } from "#/stores/optimistic-user-message-store"; import { useV1ConversationStateStore } from "#/stores/v1-conversation-state-store"; -import { useCommandStore } from "#/state/command-store"; +import { useCommandStore } from "#/stores/command-store"; import { useBrowserStore } from "#/stores/browser-store"; import { isV1Event, @@ -40,7 +40,7 @@ import type { V1SendMessageRequest, } from "#/api/conversation-service/v1-conversation-service.types"; import EventService from "#/api/event-service/event-service.api"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { isBudgetOrCreditError } from "#/utils/error-handler"; import { useTracking } from "#/hooks/use-tracking"; import { useReadConversationFile } from "#/hooks/mutation/use-read-conversation-file"; diff --git a/frontend/src/hooks/chat/use-chat-input-logic.ts b/frontend/src/hooks/chat/use-chat-input-logic.ts index d908882a40..21dc682fc9 100644 --- a/frontend/src/hooks/chat/use-chat-input-logic.ts +++ b/frontend/src/hooks/chat/use-chat-input-logic.ts @@ -4,7 +4,7 @@ import { clearEmptyContent, getTextContent, } from "#/components/features/chat/utils/chat-input.utils"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; /** * Hook for managing chat input content logic diff --git a/frontend/src/hooks/chat/use-grip-resize.ts b/frontend/src/hooks/chat/use-grip-resize.ts index b29f820399..a46d3fbe4f 100644 --- a/frontend/src/hooks/chat/use-grip-resize.ts +++ b/frontend/src/hooks/chat/use-grip-resize.ts @@ -4,7 +4,7 @@ import { CHAT_INPUT } from "#/utils/constants"; import { IMessageToSend, useConversationStore, -} from "#/state/conversation-store"; +} from "#/stores/conversation-store"; /** * Hook for managing grip resize functionality diff --git a/frontend/src/hooks/use-auto-resize.ts b/frontend/src/hooks/use-auto-resize.ts index 6a86784e0f..52546d78ec 100644 --- a/frontend/src/hooks/use-auto-resize.ts +++ b/frontend/src/hooks/use-auto-resize.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, RefObject, useRef } from "react"; -import { IMessageToSend } from "#/state/conversation-store"; +import { IMessageToSend } from "#/stores/conversation-store"; import { EPS } from "#/utils/constants"; import { getStyleHeightPx, setStyleHeightPx } from "#/utils/utils"; import { useDragResize } from "./use-drag-resize"; diff --git a/frontend/src/hooks/use-handle-plan-click.ts b/frontend/src/hooks/use-handle-plan-click.ts index 9734bab8da..1507665812 100644 --- a/frontend/src/hooks/use-handle-plan-click.ts +++ b/frontend/src/hooks/use-handle-plan-click.ts @@ -1,7 +1,7 @@ import { useCallback } from "react"; import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { useActiveConversation } from "#/hooks/query/use-active-conversation"; import { useCreateConversation } from "#/hooks/mutation/use-create-conversation"; import { displaySuccessToast } from "#/utils/custom-toast-handlers"; diff --git a/frontend/src/hooks/use-terminal.ts b/frontend/src/hooks/use-terminal.ts index d01132a85f..73652104aa 100644 --- a/frontend/src/hooks/use-terminal.ts +++ b/frontend/src/hooks/use-terminal.ts @@ -1,7 +1,7 @@ import { FitAddon } from "@xterm/addon-fit"; import { Terminal } from "@xterm/xterm"; import React from "react"; -import { Command, useCommandStore } from "#/state/command-store"; +import { Command, useCommandStore } from "#/stores/command-store"; import { parseTerminalOutput } from "#/utils/parse-terminal-output"; /* diff --git a/frontend/src/routes/conversation.tsx b/frontend/src/routes/conversation.tsx index ec19051530..0237878e1e 100644 --- a/frontend/src/routes/conversation.tsx +++ b/frontend/src/routes/conversation.tsx @@ -3,8 +3,8 @@ import { useNavigate } from "react-router"; import { useTranslation } from "react-i18next"; import { useConversationId } from "#/hooks/use-conversation-id"; -import { useCommandStore } from "#/state/command-store"; -import { useConversationStore } from "#/state/conversation-store"; +import { useCommandStore } from "#/stores/command-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { useAgentStore } from "#/stores/agent-store"; import { AgentState } from "#/types/agent-state"; diff --git a/frontend/src/routes/planner-tab.tsx b/frontend/src/routes/planner-tab.tsx index 2e5af229ef..f17a0acbc5 100644 --- a/frontend/src/routes/planner-tab.tsx +++ b/frontend/src/routes/planner-tab.tsx @@ -2,7 +2,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import LessonPlanIcon from "#/icons/lesson-plan.svg?react"; -import { useConversationStore } from "#/state/conversation-store"; +import { useConversationStore } from "#/stores/conversation-store"; import { useScrollToBottom } from "#/hooks/use-scroll-to-bottom"; import { MarkdownRenderer } from "#/components/features/markdown/markdown-renderer"; import { useHandlePlanClick } from "#/hooks/use-handle-plan-click"; diff --git a/frontend/src/services/actions.ts b/frontend/src/services/actions.ts index 86b89106ff..6f03c526e1 100644 --- a/frontend/src/services/actions.ts +++ b/frontend/src/services/actions.ts @@ -1,6 +1,6 @@ import { trackError } from "#/utils/error-handler"; import useMetricsStore from "#/stores/metrics-store"; -import { useStatusStore } from "#/state/status-store"; +import { useStatusStore } from "#/stores/status-store"; import ActionType from "#/types/action-type"; import { ActionMessage, @@ -8,7 +8,7 @@ import { StatusMessage, } from "#/types/message"; import { handleObservationMessage } from "./observations"; -import { useCommandStore } from "#/state/command-store"; +import { useCommandStore } from "#/stores/command-store"; import { queryClient } from "#/query-client-config"; import { ActionSecurityRisk, diff --git a/frontend/src/services/observations.ts b/frontend/src/services/observations.ts index 40cc1daa8a..8f1d8d3b41 100644 --- a/frontend/src/services/observations.ts +++ b/frontend/src/services/observations.ts @@ -1,5 +1,5 @@ import { ObservationMessage } from "#/types/message"; -import { useCommandStore } from "#/state/command-store"; +import { useCommandStore } from "#/stores/command-store"; import ObservationType from "#/types/observation-type"; import { useBrowserStore } from "#/stores/browser-store"; import { useAgentStore } from "#/stores/agent-store"; diff --git a/frontend/src/state/command-store.ts b/frontend/src/stores/command-store.ts similarity index 100% rename from frontend/src/state/command-store.ts rename to frontend/src/stores/command-store.ts diff --git a/frontend/src/state/conversation-store.ts b/frontend/src/stores/conversation-store.ts similarity index 100% rename from frontend/src/state/conversation-store.ts rename to frontend/src/stores/conversation-store.ts diff --git a/frontend/src/state/microagent-management-store.ts b/frontend/src/stores/microagent-management-store.ts similarity index 100% rename from frontend/src/state/microagent-management-store.ts rename to frontend/src/stores/microagent-management-store.ts diff --git a/frontend/src/state/status-store.ts b/frontend/src/stores/status-store.ts similarity index 100% rename from frontend/src/state/status-store.ts rename to frontend/src/stores/status-store.ts