fix: ai generation of mindmap fail from note text context (#8952)

Fix issue [AF-1632](https://linear.app/affine-design/issue/AF-1632).

### What Changed?
- Keep the note selection and do not set the widget tool to copilot if asking AI from selection in a note in edgeless mode.
- Remove `content` from `AIImageActionOptions`, using `input` as AI context like other actions.
This commit is contained in:
akumatus
2024-11-28 02:35:05 +00:00
parent 3c4e70a8c3
commit d2eef768ba
6 changed files with 16 additions and 29 deletions
@@ -296,7 +296,7 @@ export function setupAIProvider(client: CopilotClient) {
AIProvider.provide('makeItReal', options => {
let promptName: PromptKey = 'Make it real';
let content = options.content || '';
let content = options.input || '';
// wireframes
if (options.attachments?.length) {
@@ -374,6 +374,7 @@ Could you make a new website based on these notes and send back just the html fi
return toImage({
...options,
client,
content: options.input,
promptName,
});
});
@@ -384,6 +385,7 @@ Could you make a new website based on these notes and send back just the html fi
return toImage({
...options,
client,
content: options.input,
timeout: 120000,
promptName: promptName as PromptKey,
workflow: !!promptName?.startsWith('workflow:'),
@@ -398,6 +400,7 @@ Could you make a new website based on these notes and send back just the html fi
return toImage({
...options,
client,
content: options.input,
timeout: 120000,
promptName,
});