Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): in page mode, AI replace selection did not correctly replace the selected text (#9179)

akumatus563da3b6f422
diff --git a/packages/frontend/core/src/blocksuite/presets/ai/utils/editor-actions.ts b/packages/frontend/core/src/blocksuite/presets/ai/utils/editor-actions.ts
index e994a6e49b..8f4e84ee93 100644
--- a/packages/frontend/core/src/blocksuite/presets/ai/utils/editor-actions.ts
+++ b/packages/frontend/core/src/blocksuite/presets/ai/utils/editor-actions.ts
@@ -105,6 +105,7 @@ export const replace = async (
);
if (textSelection) {
+ host.std.command.exec('deleteText', { textSelection });
const { snapshot, job } = await markdownToSnapshot(content, host);
await job.snapshotToSlice(
snapshot,