refactor(web): 前端目录重构 — consoles/pages → layouts/features + shared

- consoles/admin/ → layouts/admin-layout/
- consoles/workbench/ → layouts/workbench-layout/ + features/chat/
- pages/ → features/ (dashboard, models, projects, not-found)
- components/ → shared/components/
- hooks/ → shared/hooks/
- utils/ → shared/utils/
- 更新所有 import 路径 (src/web/ + tests/web/)
- 更新开发文档 (README.md, frontend.md, architecture.md)
This commit is contained in:
2026-06-02 23:17:28 +08:00
parent 1f05f259d0
commit b1dec691e9
76 changed files with 249 additions and 111 deletions

View File

@@ -4,7 +4,7 @@ import { createElement } from "react";
import type { Conversation, Model } from "../../../src/shared/api";
import { ChatPanel } from "../../../src/web/consoles/workbench/components/chat/ChatPanel";
import { ChatPanel } from "../../../src/web/features/chat/ChatPanel";
import { installFetchMock, jsonResponse, renderWithProviders } from "../test-utils";
const PROJECT_ID = "proj-1";

View File

@@ -3,7 +3,7 @@ import { App as AntApp, ConfigProvider } from "antd";
import { describe, expect, test } from "bun:test";
import { createElement } from "react";
import { ErrorBoundary } from "../../../src/web/components/ErrorBoundary";
import { ErrorBoundary } from "../../../src/web/shared/components/ErrorBoundary";
function BrokenChild(): never {
throw new Error("render failed");

View File

@@ -4,7 +4,7 @@ import { createElement } from "react";
import type { Model, ProviderOption } from "../../../src/shared/api";
import { ModelTable } from "../../../src/web/pages/models/components/ModelTable";
import { ModelTable } from "../../../src/web/features/models/components/ModelTable";
import { renderWithProviders } from "../test-utils";
const OPENAI_PROVIDER: ProviderOption = {

View File

@@ -4,7 +4,7 @@ import { createElement } from "react";
import type { Provider } from "../../../src/shared/api";
import { ProviderTable } from "../../../src/web/pages/models/components/ProviderTable";
import { ProviderTable } from "../../../src/web/features/models/components/ProviderTable";
import { renderWithProviders } from "../test-utils";
const OPENAI_PROVIDER: Provider = {

View File

@@ -3,8 +3,8 @@ import { describe, expect, test } from "bun:test";
import { createElement } from "react";
import { useLocation } from "react-router";
import { Sidebar } from "../../../../src/web/components/Sidebar";
import { ADMIN_MENU_ITEMS } from "../../../../src/web/consoles/admin/menu";
import { ADMIN_MENU_ITEMS } from "../../../../src/web/layouts/admin-layout/menu";
import { Sidebar } from "../../../../src/web/shared/components/Sidebar";
import { renderWithProviders } from "../../test-utils";
function LocationProbe() {

View File

@@ -2,7 +2,7 @@ import { screen } from "@testing-library/react";
import { describe, expect, mock, test } from "bun:test";
import { createElement } from "react";
import { CodeBlockWithCopy } from "../../../../src/web/consoles/workbench/components/chat/parts/CodeBlockWithCopy";
import { CodeBlockWithCopy } from "../../../../src/web/features/chat/parts/CodeBlockWithCopy";
import { renderWithProviders } from "../../test-utils";
const mockWriteText = mock(() => Promise.resolve());

View File

@@ -2,7 +2,7 @@ import { fireEvent, screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { createElement } from "react";
import { ReasoningPart } from "../../../../src/web/consoles/workbench/components/chat/parts/ReasoningPart";
import { ReasoningPart } from "../../../../src/web/features/chat/parts/ReasoningPart";
import { renderWithProviders } from "../../test-utils";
describe("ReasoningPart", () => {

View File

@@ -2,7 +2,7 @@ import { screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { createElement } from "react";
import { ToolPart } from "../../../../src/web/consoles/workbench/components/chat/parts/ToolPart";
import { ToolPart } from "../../../../src/web/features/chat/parts/ToolPart";
import { renderWithProviders } from "../../test-utils";
describe("ToolPart 工具显示名", () => {

View File

@@ -3,7 +3,7 @@ import { render } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { createElement, useRef } from "react";
import { useCreateProject } from "../../../src/web/hooks/use-projects";
import { useCreateProject } from "../../../src/web/shared/hooks/use-projects";
import { installFetchMock, jsonResponse } from "../test-utils";
describe("QueryClient MutationCache onError", () => {