feat(core): workspace embedding settings (#11801)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced "Indexer & Embedding" workspace settings to manage AI embedding for local content, including document ignoring and attachment uploads.
  - Added UI components for embedding settings, attachments, and ignored documents with pagination and deletion capabilities.
  - Provided comprehensive file-type icons for attachments.

- **Improvements**
  - Added a new tab for indexing and embedding in workspace settings navigation.
  - Included test identifiers on key UI elements to enhance automated testing.

- **Localization**
  - Added English localization strings covering all embedding-related UI text and actions.

- **Bug Fixes**
  - Enabled previously skipped end-to-end tests for embedding settings to improve reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
yoyoyohamapi
2025-05-15 09:36:28 +00:00
parent 6224344a4f
commit 6c9f28e08b
25 changed files with 1266 additions and 86 deletions
@@ -2,6 +2,7 @@ import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-in
import { ServerService } from '@affine/core/modules/cloud';
import type { SettingTab } from '@affine/core/modules/dialogs/constant';
import { WorkspaceService } from '@affine/core/modules/workspace';
import { IndexerEmbeddingSettings } from '@affine/core/modules/workspace-indexer-embedding';
import { ServerDeploymentType } from '@affine/graphql';
import { useI18n } from '@affine/i18n';
import {
@@ -53,6 +54,8 @@ export const WorkspaceSetting = ({
return <WorkspaceSettingLicense onCloseSetting={onCloseSetting} />;
case 'workspace:integrations':
return <IntegrationSetting />;
case 'workspace:indexer-embedding':
return <IndexerEmbeddingSettings />;
default:
return null;
}
@@ -106,6 +109,12 @@ export const useWorkspaceSettingList = (): SettingSidebarItem[] => {
icon: <SaveIcon />,
testId: 'workspace-setting:storage',
},
{
key: 'workspace:indexer-embedding',
title: t['Indexer & Embedding'](),
icon: <SettingsIcon />,
testId: 'workspace-setting:indexer-embedding',
},
showBilling && {
key: 'workspace:billing' as SettingTab,
title: t['com.affine.settings.workspace.billing'](),