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 = {
|
const GenerateFromTextAIGroup: AIItemGroupConfig = {
|
||||||
name: 'generate from text',
|
name: 'generate from text',
|
||||||
items: [
|
items: [
|
||||||
@@ -347,6 +334,13 @@ const GenerateFromTextAIGroup: AIItemGroupConfig = {
|
|||||||
showWhen: textBlockShowWhen,
|
showWhen: textBlockShowWhen,
|
||||||
handler: actionToHandler('writeOutline', AIPenIconWithAnimation),
|
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',
|
name: 'Brainstorm ideas with mind map',
|
||||||
testId: 'action-brainstorm-mindmap',
|
testId: 'action-brainstorm-mindmap',
|
||||||
@@ -405,7 +399,6 @@ export const pageAIGroups: AIItemGroupConfig[] = [
|
|||||||
ReviewCodeAIGroup,
|
ReviewCodeAIGroup,
|
||||||
ReviewImageAIGroup,
|
ReviewImageAIGroup,
|
||||||
EditTextAIGroup,
|
EditTextAIGroup,
|
||||||
TouchUpImageAIGroup,
|
|
||||||
GenerateFromTextAIGroup,
|
GenerateFromTextAIGroup,
|
||||||
DraftFromTextAIGroup,
|
DraftFromTextAIGroup,
|
||||||
OthersAIGroup,
|
OthersAIGroup,
|
||||||
@@ -431,7 +424,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'touch up image',
|
name: 'generate from text',
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
name: 'Generate an image',
|
name: 'Generate an image',
|
||||||
@@ -445,6 +438,11 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
|||||||
blockActionTrackerOptions
|
blockActionTrackerOptions
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'touch up image',
|
||||||
|
items: [
|
||||||
{
|
{
|
||||||
name: 'Image processing',
|
name: 'Image processing',
|
||||||
testId: 'action-image-processing',
|
testId: 'action-image-processing',
|
||||||
|
|||||||
@@ -281,9 +281,31 @@ const reviewTextGroup: AIItemGroupConfig = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
const touchUpImageGroup: AIItemGroupConfig = {
|
const generateFromTextGroup: AIItemGroupConfig = {
|
||||||
name: 'touch up image',
|
name: 'generate from text',
|
||||||
items: [
|
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',
|
name: 'Generate an image',
|
||||||
icon: ImageIcon(),
|
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',
|
name: 'Expand from this mind map node',
|
||||||
icon: MindmapNodeIcon(),
|
icon: MindmapNodeIcon(),
|
||||||
@@ -571,7 +564,6 @@ export const edgelessAIGroups: AIItemGroupConfig[] = [
|
|||||||
reviewCodeGroup,
|
reviewCodeGroup,
|
||||||
reviewImageGroup,
|
reviewImageGroup,
|
||||||
editTextGroup,
|
editTextGroup,
|
||||||
touchUpImageGroup,
|
|
||||||
generateFromTextGroup,
|
generateFromTextGroup,
|
||||||
draftFromTextGroup,
|
draftFromTextGroup,
|
||||||
othersGroup,
|
othersGroup,
|
||||||
|
|||||||
Reference in New Issue
Block a user