mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix(core): generate image from text group (#13417)
> CLOSE AF-2785 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Streamlined AI action groups by consolidating image generation and text generation actions under a unified "generate from text" group. * Image processing and filtering actions are now organized into a distinct "touch up image" group for improved clarity in dynamic image options. * **Refactor** * Simplified and reorganized AI action groups for a more intuitive user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -295,19 +295,6 @@ const ReviewTextAIGroup: AIItemGroupConfig = {
|
||||
],
|
||||
};
|
||||
|
||||
const TouchUpImageAIGroup: AIItemGroupConfig = {
|
||||
name: 'touch up image',
|
||||
items: [
|
||||
{
|
||||
name: 'Generate an image',
|
||||
testId: 'action-generate-image',
|
||||
icon: ImageIcon(),
|
||||
showWhen: textBlockShowWhen,
|
||||
handler: actionToHandler('createImage', AIImageIconWithAnimation),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const GenerateFromTextAIGroup: AIItemGroupConfig = {
|
||||
name: 'generate from text',
|
||||
items: [
|
||||
@@ -347,6 +334,13 @@ const GenerateFromTextAIGroup: AIItemGroupConfig = {
|
||||
showWhen: textBlockShowWhen,
|
||||
handler: actionToHandler('writeOutline', AIPenIconWithAnimation),
|
||||
},
|
||||
{
|
||||
name: 'Generate an image',
|
||||
testId: 'action-generate-image',
|
||||
icon: ImageIcon(),
|
||||
showWhen: textBlockShowWhen,
|
||||
handler: actionToHandler('createImage', AIImageIconWithAnimation),
|
||||
},
|
||||
{
|
||||
name: 'Brainstorm ideas with mind map',
|
||||
testId: 'action-brainstorm-mindmap',
|
||||
@@ -405,7 +399,6 @@ export const pageAIGroups: AIItemGroupConfig[] = [
|
||||
ReviewCodeAIGroup,
|
||||
ReviewImageAIGroup,
|
||||
EditTextAIGroup,
|
||||
TouchUpImageAIGroup,
|
||||
GenerateFromTextAIGroup,
|
||||
DraftFromTextAIGroup,
|
||||
OthersAIGroup,
|
||||
@@ -431,7 +424,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'touch up image',
|
||||
name: 'generate from text',
|
||||
items: [
|
||||
{
|
||||
name: 'Generate an image',
|
||||
@@ -445,6 +438,11 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
||||
blockActionTrackerOptions
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'touch up image',
|
||||
items: [
|
||||
{
|
||||
name: 'Image processing',
|
||||
testId: 'action-image-processing',
|
||||
|
||||
@@ -281,9 +281,31 @@ const reviewTextGroup: AIItemGroupConfig = {
|
||||
],
|
||||
};
|
||||
|
||||
const touchUpImageGroup: AIItemGroupConfig = {
|
||||
name: 'touch up image',
|
||||
const generateFromTextGroup: AIItemGroupConfig = {
|
||||
name: 'generate from text',
|
||||
items: [
|
||||
{
|
||||
name: 'Summarize',
|
||||
icon: PenIcon(),
|
||||
testId: 'action-summarize',
|
||||
showWhen: noteBlockOrTextShowWhen,
|
||||
handler: actionToHandler('summary', AIPenIconWithAnimation),
|
||||
},
|
||||
{
|
||||
name: 'Generate headings',
|
||||
icon: PenIcon(),
|
||||
testId: 'action-generate-headings',
|
||||
showWhen: noteBlockOrTextShowWhen,
|
||||
handler: actionToHandler('createHeadings', AIPenIconWithAnimation),
|
||||
beta: true,
|
||||
},
|
||||
{
|
||||
name: 'Generate outline',
|
||||
icon: PenIcon(),
|
||||
testId: 'action-generate-outline',
|
||||
showWhen: noteBlockOrTextShowWhen,
|
||||
handler: actionToHandler('writeOutline', AIPenIconWithAnimation),
|
||||
},
|
||||
{
|
||||
name: 'Generate an image',
|
||||
icon: ImageIcon(),
|
||||
@@ -359,35 +381,6 @@ const touchUpImageGroup: AIItemGroupConfig = {
|
||||
}
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const generateFromTextGroup: AIItemGroupConfig = {
|
||||
name: 'generate from text',
|
||||
items: [
|
||||
{
|
||||
name: 'Summarize',
|
||||
icon: PenIcon(),
|
||||
testId: 'action-summarize',
|
||||
showWhen: noteBlockOrTextShowWhen,
|
||||
handler: actionToHandler('summary', AIPenIconWithAnimation),
|
||||
},
|
||||
{
|
||||
name: 'Generate headings',
|
||||
icon: PenIcon(),
|
||||
testId: 'action-generate-headings',
|
||||
showWhen: noteBlockOrTextShowWhen,
|
||||
handler: actionToHandler('createHeadings', AIPenIconWithAnimation),
|
||||
beta: true,
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Generate outline',
|
||||
icon: PenIcon(),
|
||||
testId: 'action-generate-outline',
|
||||
showWhen: noteBlockOrTextShowWhen,
|
||||
handler: actionToHandler('writeOutline', AIPenIconWithAnimation),
|
||||
},
|
||||
{
|
||||
name: 'Expand from this mind map node',
|
||||
icon: MindmapNodeIcon(),
|
||||
@@ -571,7 +564,6 @@ export const edgelessAIGroups: AIItemGroupConfig[] = [
|
||||
reviewCodeGroup,
|
||||
reviewImageGroup,
|
||||
editTextGroup,
|
||||
touchUpImageGroup,
|
||||
generateFromTextGroup,
|
||||
draftFromTextGroup,
|
||||
othersGroup,
|
||||
|
||||
Reference in New Issue
Block a user