Skip to content

Commit 0f34a0a

Browse files
Jetpack AI Sidebar: add chip descriptions and rename review labels (#112034)
* Jetpack AI Sidebar: add chip descriptions and rename review labels - Add a one-line description to the starting-screen suggestion chips: Optimize Title, Simple Review, Editorial Review - Rename labels: Generate Feedback → Simple Review, AI Editorial Review → Editorial Review - Widen getEmptyViewSuggestions/useSuggestions return types with an optional description - Update label assertions and add a description-presence test Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Jetpack AI Sidebar: add description to the Proofread chip - Add "Correct spelling, grammar, and punctuation." to PROOFREAD_SUGGESTION - Extend the description test to cover Proofread (enable proofreadContent) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Jetpack AI Sidebar: add SEO Enhancer + Generate Excerpt descriptions - Add descriptions to the SEO Enhancer and Generate Excerpt chips - Refine the Optimize Title description to differentiate it from SEO Enhancer - Extend the description test to cover the two new chips Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Bump agenttic to 0.1.74 --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent bab3e26 commit 0f34a0a

9 files changed

Lines changed: 91 additions & 51 deletions

File tree

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@automattic/accessible-focus": "workspace:^",
1616
"@automattic/agents-manager": "workspace:^",
17-
"@automattic/agenttic-ui": "^0.1.72",
17+
"@automattic/agenttic-ui": "^0.1.74",
1818
"@automattic/api-core": "workspace:^",
1919
"@automattic/api-queries": "workspace:^",
2020
"@automattic/block-renderer": "workspace:^",

packages/agents-manager/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"watch": "tsc --build ./tsconfig.json --watch"
4242
},
4343
"dependencies": {
44-
"@automattic/agenttic-client": "^0.1.72",
45-
"@automattic/agenttic-ui": "^0.1.72",
44+
"@automattic/agenttic-client": "^0.1.74",
45+
"@automattic/agenttic-ui": "^0.1.74",
4646
"@automattic/calypso-analytics": "workspace:^",
4747
"@automattic/components": "workspace:^",
4848
"@automattic/data-stores": "workspace:^",

packages/block-notes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"dependencies": {
4343
"@automattic/agents-manager": "workspace:^",
44-
"@automattic/agenttic-client": "^0.1.72",
44+
"@automattic/agenttic-client": "^0.1.74",
4545
"@automattic/calypso-analytics": "workspace:^",
4646
"@wordpress/abilities": "^0.14.0",
4747
"@wordpress/api-fetch": "^7.48.0",

packages/image-studio/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
},
5252
"dependencies": {
5353
"@automattic/agents-manager": "workspace:^",
54-
"@automattic/agenttic-client": "^0.1.72",
55-
"@automattic/agenttic-ui": "^0.1.72",
54+
"@automattic/agenttic-client": "^0.1.74",
55+
"@automattic/agenttic-ui": "^0.1.74",
5656
"@automattic/calypso-analytics": "workspace:^",
5757
"@automattic/oauth-token": "workspace:^",
5858
"@wordpress/abilities": "^0.14.0",

packages/jetpack-ai-sidebar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"typecheck": "tsc --build --dry"
4545
},
4646
"dependencies": {
47-
"@automattic/agenttic-client": "^0.1.72",
47+
"@automattic/agenttic-client": "^0.1.74",
4848
"@automattic/calypso-analytics": "workspace:^",
4949
"@automattic/calypso-url": "workspace:^",
5050
"@automattic/components": "workspace:^",

packages/jetpack-ai-sidebar/src/index.test.ts

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,56 +1018,56 @@ describe( 'getEmptyViewSuggestions', () => {
10181018
it( 'hides post suggestions without a sidebar config', () => {
10191019
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
10201020
expect( labels ).not.toContain( 'Optimize Title' );
1021-
expect( labels ).not.toContain( 'AI Editorial Review' );
1021+
expect( labels ).not.toContain( 'Editorial Review' );
10221022
} );
10231023

1024-
it( 'shows AI Editorial Review when enabled by agentsManagerData', () => {
1024+
it( 'shows Editorial Review when enabled by agentsManagerData', () => {
10251025
installAiEditorialReviewData();
10261026
installPostTypeMock( 'post' );
10271027
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
10281028
expect( labels ).not.toContain( 'Optimize Title' );
1029-
expect( labels ).toContain( 'AI Editorial Review' );
1030-
expect( labels ).toContain( 'Generate Feedback' );
1029+
expect( labels ).toContain( 'Editorial Review' );
1030+
expect( labels ).toContain( 'Simple Review' );
10311031
} );
10321032

1033-
it( 'hides AI Editorial Review on page editors', () => {
1033+
it( 'hides Editorial Review on page editors', () => {
10341034
installAiEditorialReviewData();
10351035
installPostTypeMock( 'page' );
10361036

10371037
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
10381038

10391039
expect( labels ).not.toContain( 'Optimize Title' );
1040-
expect( labels ).not.toContain( 'AI Editorial Review' );
1040+
expect( labels ).not.toContain( 'Editorial Review' );
10411041
} );
10421042

1043-
it( 'hides AI Editorial Review until the post type is known', () => {
1043+
it( 'hides Editorial Review until the post type is known', () => {
10441044
installAiEditorialReviewData();
10451045
installPostTypeMock();
10461046

10471047
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
10481048

10491049
expect( labels ).not.toContain( 'Optimize Title' );
1050-
expect( labels ).not.toContain( 'AI Editorial Review' );
1050+
expect( labels ).not.toContain( 'Editorial Review' );
10511051
} );
10521052

1053-
it( 'hides Generate Feedback until the post has a saved post ID', () => {
1053+
it( 'hides Simple Review until the post has a saved post ID', () => {
10541054
installAiEditorialReviewData();
10551055
installPostTypeMock( 'post', null );
10561056

10571057
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
10581058

1059-
expect( labels ).not.toContain( 'Generate Feedback' );
1060-
expect( labels ).toContain( 'AI Editorial Review' );
1059+
expect( labels ).not.toContain( 'Simple Review' );
1060+
expect( labels ).toContain( 'Editorial Review' );
10611061
} );
10621062

1063-
it( 'hides Generate Feedback when the preview feature disables it', () => {
1063+
it( 'hides Simple Review when the preview feature disables it', () => {
10641064
installAiEditorialReviewData( { generateFeedback: false } );
10651065
installPostTypeMock( 'post' );
10661066

10671067
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
10681068

1069-
expect( labels ).not.toContain( 'Generate Feedback' );
1070-
expect( labels ).toContain( 'AI Editorial Review' );
1069+
expect( labels ).not.toContain( 'Simple Review' );
1070+
expect( labels ).toContain( 'Editorial Review' );
10711071
} );
10721072

10731073
it( 'hides Proofread by default and shows it when the preview feature enables it', () => {
@@ -1100,7 +1100,7 @@ describe( 'getEmptyViewSuggestions', () => {
11001100
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
11011101

11021102
expect( labels ).not.toContain( 'Optimize Title' );
1103-
expect( labels ).not.toContain( 'AI Editorial Review' );
1103+
expect( labels ).not.toContain( 'Editorial Review' );
11041104
} );
11051105

11061106
it( 'treats missing features as disabled', () => {
@@ -1115,8 +1115,37 @@ describe( 'getEmptyViewSuggestions', () => {
11151115
const labels = getEmptyViewSuggestions().map( ( suggestion ) => suggestion.label );
11161116

11171117
expect( labels ).not.toContain( 'Optimize Title' );
1118-
expect( labels ).toContain( 'AI Editorial Review' );
1119-
expect( labels ).not.toContain( 'Generate Feedback' );
1118+
expect( labels ).toContain( 'Editorial Review' );
1119+
expect( labels ).not.toContain( 'Simple Review' );
1120+
} );
1121+
1122+
it( 'attaches a one-line description to every starting-screen suggestion', () => {
1123+
installAiEditorialReviewData( {
1124+
optimizeTitleSuggestion: true,
1125+
proofreadContent: true,
1126+
seoSuggestions: true,
1127+
excerptSuggestion: true,
1128+
} );
1129+
installPostTypeMock( 'post' );
1130+
1131+
const suggestions = getEmptyViewSuggestions();
1132+
const byLabel = ( label: string ) =>
1133+
suggestions.find( ( suggestion ) => suggestion.label === label );
1134+
1135+
[
1136+
'Optimize Title',
1137+
'Proofread',
1138+
'Simple Review',
1139+
'Editorial Review',
1140+
'SEO Enhancer',
1141+
'Generate Excerpt',
1142+
].forEach( ( label ) => {
1143+
const suggestion = byLabel( label );
1144+
expect( suggestion ).toBeDefined();
1145+
expect( typeof suggestion?.description ).toBe( 'string' );
1146+
expect( suggestion?.description ).toBeTruthy();
1147+
expect( suggestion?.description ).not.toContain( '\n' );
1148+
} );
11201149
} );
11211150

11221151
it( 'shows Generate Excerpt when the excerptSuggestion feature is enabled', () => {
@@ -1429,8 +1458,8 @@ describe( 'useSuggestions', () => {
14291458
latestSuggestions =
14301459
onSuggestions.mock.calls[ onSuggestions.mock.calls.length - 1 ]?.[ 0 ] ?? [];
14311460
expect( latestSuggestions.map( ( suggestion: any ) => suggestion.label ) ).toEqual( [
1432-
'Generate Feedback',
1433-
'AI Editorial Review',
1461+
'Simple Review',
1462+
'Editorial Review',
14341463
] );
14351464
} );
14361465

@@ -1486,11 +1515,11 @@ describe( 'useSuggestions', () => {
14861515
const latestSuggestions =
14871516
onSuggestions.mock.calls[ onSuggestions.mock.calls.length - 1 ]?.[ 0 ] ?? [];
14881517
expect( latestSuggestions.map( ( suggestion: any ) => suggestion.label ) ).toEqual( [
1489-
'AI Editorial Review',
1518+
'Editorial Review',
14901519
] );
14911520
} );
14921521

1493-
it( 'keeps Generate Feedback on the backend path when clicked', () => {
1522+
it( 'keeps Simple Review on the backend path when clicked', () => {
14941523
installAiEditorialReviewData();
14951524
installPostTypeMock( 'post' );
14961525
const addMessage = jest.fn();
@@ -1541,7 +1570,7 @@ describe( 'useSuggestions', () => {
15411570
expect( mockSetIsSplitScreen ).toHaveBeenCalledWith( true );
15421571
} );
15431572

1544-
it( 'opens split-screen when the AI Editorial Review suggestion is clicked', () => {
1573+
it( 'opens split-screen when the Editorial Review suggestion is clicked', () => {
15451574
installAiEditorialReviewData();
15461575
installPostTypeMock( 'post' );
15471576
const mediationPrompt = getEmptyViewSuggestions().find(
@@ -1667,7 +1696,7 @@ describe( 'useSuggestions', () => {
16671696
expect( getTracksCalls( 'jetpack_ai_block_transformation_suggestion_click' ) ).toEqual( [] );
16681697
} );
16691698

1670-
it( 'does not open split-screen when AI Editorial Review is unavailable', () => {
1699+
it( 'does not open split-screen when Editorial Review is unavailable', () => {
16711700
installAiEditorialReviewData();
16721701
mockCurrentPostType = 'page';
16731702
installPostTypeMock( 'page' );
@@ -1788,7 +1817,7 @@ describe( 'contextProvider', () => {
17881817
} );
17891818
} );
17901819

1791-
it( 'suppresses full page content for the next Generate Feedback chip request', () => {
1820+
it( 'suppresses full page content for the next Simple Review chip request', () => {
17921821
installAiEditorialReviewData();
17931822
installContextProviderMock();
17941823
const feedbackPrompt = getEmptyViewSuggestions().find(
@@ -1836,7 +1865,7 @@ describe( 'contextProvider', () => {
18361865
expect( contextProvider.getClientContext().jetpackAi ).toBeUndefined();
18371866
} );
18381867

1839-
it( 'clears pending Generate Feedback content suppression when another suggestion is clicked', () => {
1868+
it( 'clears pending Simple Review content suppression when another suggestion is clicked', () => {
18401869
installAiEditorialReviewData();
18411870
installContextProviderMock();
18421871
const suggestions = getEmptyViewSuggestions();

packages/jetpack-ai-sidebar/src/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ let lastBlockTransformationSuggestionContext: {
9595
const OPTIMIZE_TITLE_SUGGESTION = {
9696
id: 'optimize-title',
9797
label: __( 'Optimize Title', 'jetpack' ),
98+
description: __(
99+
'Refine the title based on your post’s content and SEO best practices.',
100+
'jetpack'
101+
),
98102
prompt: __( 'Optimize the title of this post', 'jetpack' ),
99103
};
100104

@@ -107,6 +111,7 @@ const OPTIMIZE_TITLE_SUGGESTION = {
107111
const GENERATE_EXCERPT_SUGGESTION = {
108112
id: 'generate-excerpt',
109113
label: __( 'Generate Excerpt', 'jetpack' ),
114+
description: __( 'Generate an excerpt for your post.', 'jetpack' ),
110115
prompt: __( 'Generate an excerpt for this post', 'jetpack' ),
111116
};
112117

@@ -129,6 +134,7 @@ const GENERATE_EXCERPT_SUGGESTION = {
129134
const SEO_ENHANCER_SUGGESTION = {
130135
id: 'seo-enhancer',
131136
label: __( 'SEO Enhancer', 'jetpack' ),
137+
description: __( 'Generate metadata for the contents of the post to optimize SEO.', 'jetpack' ),
132138
prompt: '',
133139
options: [
134140
{
@@ -157,7 +163,8 @@ const SEO_ENHANCER_SUGGESTION = {
157163
*/
158164
const AI_EDITORIAL_REVIEW_SUGGESTION = {
159165
id: 'mediate-review-notes',
160-
label: __( 'AI Editorial Review', 'jetpack' ),
166+
label: __( 'Editorial Review', 'jetpack' ),
167+
description: __( 'In-depth review against your content guidelines.', 'jetpack' ),
161168
prompt: __(
162169
'Run an AI Editorial Review for this post. Check the content, reviewer notes, and site guidelines, then surface conflicts, implications, guideline issues, and suggested edits.',
163170
'jetpack'
@@ -166,7 +173,8 @@ const AI_EDITORIAL_REVIEW_SUGGESTION = {
166173

167174
const POST_FEEDBACK_SUGGESTION = {
168175
id: 'generate-feedback',
169-
label: __( 'Generate Feedback', 'jetpack' ),
176+
label: __( 'Simple Review', 'jetpack' ),
177+
description: __( 'Quick feedback on your content’s structure.', 'jetpack' ),
170178
prompt: __(
171179
'Generate feedback for this saved post. Review the saved title and saved block content for content structure, reader clarity, completeness, media/caption/link issues, and obvious publishability concerns. Return practical feedback with one-click suggestions when safe.',
172180
'jetpack'
@@ -176,6 +184,7 @@ const POST_FEEDBACK_SUGGESTION = {
176184
const PROOFREAD_SUGGESTION = {
177185
id: 'proofread-content',
178186
label: __( 'Proofread', 'jetpack' ),
187+
description: __( 'Correct spelling, grammar, and punctuation.', 'jetpack' ),
179188
prompt: __(
180189
'Proofread this saved post for spelling, grammar, and punctuation. Review the saved title and saved block content, and return practical fixes with one-click suggestions when safe.',
181190
'jetpack'
@@ -863,6 +872,7 @@ export function useCheckpoint(): any {
863872
export function getEmptyViewSuggestions(): Array< {
864873
id: string;
865874
label: string;
875+
description?: string;
866876
prompt?: string;
867877
options?: SuggestionOption[];
868878
} > {
@@ -1030,6 +1040,7 @@ export function useSuggestions(
10301040
suggestions: Array< {
10311041
id: string;
10321042
label: string;
1043+
description?: string;
10331044
prompt?: string;
10341045
options?: SuggestionOption[];
10351046
} >;

packages/odie-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"watch": "tsc --build ./tsconfig.json --watch"
4242
},
4343
"dependencies": {
44-
"@automattic/agenttic-ui": "^0.1.72",
44+
"@automattic/agenttic-ui": "^0.1.74",
4545
"@automattic/components": "workspace:^",
4646
"@automattic/i18n-utils": "workspace:^",
4747
"@automattic/zendesk-client": "workspace:^",

0 commit comments

Comments
 (0)