mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor(editor): reorg blocksuite ai code (#10372)
### TL;DR Relocated AI-related code from `presets` directory to a dedicated `ai` directory for better organization and maintainability. ### What changed? - Moved AI-related code from `blocksuite/presets/ai` to `blocksuite/ai` - Relocated AI chat block code from `blocksuite/blocks` to `blocksuite/ai/blocks` - Updated imports across files to reflect new directory structure - Renamed `registerBlocksuitePresetsCustomComponents` to `registerAIEffects` - Fixed path references in GitHub workflow file ### How to test? 1. Build and run the application 2. Verify AI functionality works as expected: - Test AI chat blocks - Check AI panel functionality - Verify AI copilot features - Ensure AI-related UI components render correctly ### Why make this change? This restructuring improves code organization by: - Giving AI features a dedicated directory that better reflects their importance - Making the codebase more maintainable by grouping related AI functionality - Reducing confusion by removing AI code from the more general `presets` directory - Creating clearer boundaries between AI and non-AI related code
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
|
||||
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
|
||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||
import { DocsService } from '@affine/core/modules/doc';
|
||||
import { TemplateDocService } from '@affine/core/modules/template-doc';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
notify,
|
||||
useConfirmModal,
|
||||
} from '@affine/component';
|
||||
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
|
||||
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
|
||||
import { useDeleteCollectionInfo } from '@affine/core/components/hooks/affine/use-delete-collection-info';
|
||||
import { IsFavoriteIcon } from '@affine/core/components/pure/icons';
|
||||
import { CollectionService } from '@affine/core/modules/collection';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
toast,
|
||||
useConfirmModal,
|
||||
} from '@affine/component';
|
||||
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
|
||||
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
|
||||
import { DocPermissionGuard } from '@affine/core/components/guard/doc-guard';
|
||||
import { useBlockSuiteMetaHelper } from '@affine/core/components/hooks/affine/use-block-suite-meta-helper';
|
||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
MenuSub,
|
||||
notify,
|
||||
} from '@affine/component';
|
||||
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
|
||||
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
|
||||
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
|
||||
import type {
|
||||
ExplorerTreeNodeIcon,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
toast,
|
||||
useConfirmModal,
|
||||
} from '@affine/component';
|
||||
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
|
||||
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
|
||||
import { IsFavoriteIcon } from '@affine/core/components/pure/icons';
|
||||
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
|
||||
import { DocsService } from '@affine/core/modules/doc';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
|
||||
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
|
||||
import {
|
||||
ExplorerService,
|
||||
ExplorerTreeRoot,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useThemeColorV2 } from '@affine/component';
|
||||
import { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';
|
||||
import type { AffineEditorContainer } from '@affine/core/blocksuite/block-suite-editor';
|
||||
import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary';
|
||||
import type { AffineEditorContainer } from '@affine/core/components/blocksuite/block-suite-editor';
|
||||
import { useActiveBlocksuiteEditor } from '@affine/core/components/hooks/use-block-suite-editor';
|
||||
import { usePageDocumentTitle } from '@affine/core/components/hooks/use-global-state';
|
||||
import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
MobileMenu,
|
||||
MobileMenuItem,
|
||||
} from '@affine/component/ui/menu';
|
||||
import { useFavorite } from '@affine/core/components/blocksuite/block-suite-header/favorite';
|
||||
import { useFavorite } from '@affine/core/blocksuite/block-suite-header/favorite';
|
||||
import { IsFavoriteIcon } from '@affine/core/components/pure/icons';
|
||||
import { DocInfoSheet } from '@affine/core/mobile/components';
|
||||
import { MobileTocMenu } from '@affine/core/mobile/components/toc-menu';
|
||||
|
||||
Reference in New Issue
Block a user