feat(ios): add intelligents button (#9281)

Co-authored-by: 砍砍 <git@qaq.wiki>
This commit is contained in:
EYHN
2024-12-24 15:51:11 +08:00
committed by GitHub
parent fbe3e08769
commit 3cf4bcf651
78 changed files with 3283 additions and 114 deletions
@@ -10,6 +10,7 @@ import { PageDetailEditor } from '@affine/core/components/page-detail-editor';
import { DetailPageWrapper } from '@affine/core/desktop/pages/workspace/detail-page/detail-page-wrapper';
import { PageHeader } from '@affine/core/mobile/components';
import { useGlobalEvent } from '@affine/core/mobile/hooks/use-global-events';
import { AIButtonService } from '@affine/core/modules/ai-button';
import { DocService } from '@affine/core/modules/doc';
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
import { EditorService } from '@affine/core/modules/editor';
@@ -57,6 +58,7 @@ const DetailPageImpl = () => {
workspaceService,
globalContextService,
featureFlagService,
aIButtonService,
} = useServices({
WorkbenchService,
ViewService,
@@ -65,6 +67,7 @@ const DetailPageImpl = () => {
WorkspaceService,
GlobalContextService,
FeatureFlagService,
AIButtonService,
});
const editor = editorService.editor;
const workspace = workspaceService.workspace;
@@ -124,6 +127,14 @@ const DetailPageImpl = () => {
enableEdgelessEditing,
]);
useEffect(() => {
aIButtonService.presentAIButton(true);
return () => {
aIButtonService.presentAIButton(false);
};
}, [aIButtonService]);
useEffect(() => {
globalContext.isTrashDoc.set(!!isInTrash);