fix(core): disable space ai guidance for non-paragraph block (#11847)

### TL;DR

Disable space ai guidance for non-paragraph block

> CLOSE AI-67
This commit is contained in:
yoyoyohamapi
2025-04-21 08:04:51 +00:00
parent 1efcd480af
commit f65c8f8fa6
2 changed files with 26 additions and 1 deletions

View File

@@ -27,7 +27,12 @@ export function setupSpaceAIEntry(panel: AffineAIPanelWidget) {
const selection = host.selection.find(TextSelection);
if (selection && selection.isCollapsed() && selection.from.index === 0) {
const block = host.view.getBlock(selection.blockId);
if (!block?.model?.text || block.model.text?.length > 0) return;
if (
!block?.model?.text ||
block.model.text?.length > 0 ||
block.model.flavour !== 'affine:paragraph'
)
return;
event.preventDefault();
handleInlineAskAIAction(host);