Skip to content

Commit 17d6fe4

Browse files
authored
DOC-3468 - Document TinyMCE AI 8.5 custom reviews, commands, and quickbars integration (#4070)
* DOC-3468: Document TinyMCE AI 8.5 custom reviews, commands, and quickbars integration - Add tinymceai_reviews option with ai-reviews-custom for custom review - Document all new Quick Action commands and TinyMCEAIChatPrompt - Add id property to tinymceai_quickactions_custom for toolbar/menu/quickbars use - Update full-featured and tinymceai-review demos with explicit tinymceai_reviews - Update editor-command-identifiers and tinymceai-actions for quickbars integration - Remove undocumented TinyMCEAIDiagnostic command - Update review sidebar screenshot * trigger staging preview build * DOC-3468: Fix command partial headings from block titles to section headings * DOC-3468: Address PR feedback — custom reviews ship by default - Remove explicit tinymceai_reviews from all 4 demo files (default config) - Simplify Custom review table row and NOTE (no qualifier needed) - Apply wording suggestion for quickbars custom action note - Reword Custom review section as default rather than conditional * DOC-3468: Address remaining PR feedback — id scope, floating sidebar, antora revert - Revert antora.yml live demo URL from 8-dev to 8 - Scope custom action `id` to menu items only (confirmed from source: addMenuItem only, no addButton) — remove quickbars/toolbar references - Remove dedicated floating sidebar ToggleSidebar section; replace with sidebar-type-agnostic NOTE (TINY-14243 made API identical for both) - Clean up id example to remove misleading quickbars config * DOC-3468: Fix review label mismatch — "Adjust length" to "Change length" Aligns the editor label in the built-in reviews table and quick actions reference table with the actual UI string from source (I18n.CHANGE_LENGTH).
1 parent 8968752 commit 17d6fe4

7 files changed

Lines changed: 121 additions & 20 deletions

File tree

10.5 KB
Loading

modules/ROOT/pages/editor-command-identifiers.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ include::partial$commands/tableofcontents-cmds.adoc[leveloffset=+3]
530530
[[tinymceai]]
531531
==== TinyMCE AI
532532

533-
The xref:tinymceai.adoc[TinyMCE AI (`+tinymceai+`)] plugin registers AI Chat and AI Review sidebars. The following subsection describes how to open and close them using a core editor command.
533+
The xref:tinymceai.adoc[TinyMCE AI (`+tinymceai+`)] plugin registers AI Chat and AI Review sidebars, Quick Actions-related editor commands, and uses the core `+ToggleSidebar+` command for sidebar visibility. The following partial covers `+ToggleSidebar+`, floating-sidebar behavior, and plugin command names.
534534

535535
include::partial$commands/tinymceai-cmds.adoc[leveloffset=+3]
536536

modules/ROOT/pages/tinymceai-actions.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ The following table lists built-in Quick Actions.
138138

139139
|**Fix Grammar** |`ai-quickactions-check-grammar` |`fix-grammar` |Correct grammar, spelling, and punctuation errors. |✓ |✓
140140

141-
|**Adjust length** |`ai-quickactions-change-length` |`make-shorter`, `make-longer` |Shorten or lengthen the selection. Each option is its own system action. |✓ |✓
141+
|**Change length** |`ai-quickactions-change-length` |`make-shorter`, `make-longer` |Shorten or lengthen the selection. Each option is its own system action. |✓ |✓
142142

143143
|**Adjust Tone**
144144
a|

modules/ROOT/pages/tinymceai-review.adoc

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ image::tinymceai/tinymce-ai-review-sidebar-command-categories-proofread-clarity.
3030
[[integration]]
3131
== Integration
3232

33-
To start using the Review feature, add `+tinymceai+` to the plugins option. This will automatically add the image:icons-premium/ai-review.svg[Review icon,24px] Review toolbar button and menu item to the default {productname} toolbar and menu.
33+
To start using the Review feature, add `+tinymceai+` to the plugins configuration option. This will automatically add the image:icons-premium/ai-review.svg[Review icon,24px] Review toolbar button and menu item to the default {productname} toolbar and menu.
3434

3535
See xref:tinymceai.adoc[Plugin Reference] for more information regarding installation and enabling AI features.
3636

@@ -42,7 +42,7 @@ While in the Review Mode, the editor remains read-only and allows browsing sugge
4242

4343
image::tinymceai/tinymce-ai-review-improve-readability-suggestion-cards-and-underlines.png[{pluginname} Review sidebar with suggestions,width=80%]
4444

45-
Review suggestions can be individually skipped or applied by clicking the corresponding buttons. Changes that were accepted or dismissed become greyed out in the interface. The "Complete" button in the top of the sidebar enables actions such as:
45+
Review suggestions can be individually skipped or applied by clicking the corresponding buttons. Changes that were accepted or dismissed become grayed out in the interface. The "Complete" button in the top of the sidebar enables actions such as:
4646

4747
- Skipping or applying the remaining suggestions in bulk
4848
- Completing the review with the currently applied suggestions (and skipping the rest)
@@ -63,20 +63,30 @@ Built-in system reviews are listed below. The **Editor** column is the label in
6363

6464
|**Improve readability** |Readability |Improve readability through sentence structure, paragraph structure, transitions, word choice, and reading level. |✓ |✓
6565

66-
|**Adjust length** |Length Optimization |Shorten or lengthen the text while preserving key information. The editor offers _Longer_ and _Shorter_ options. |✓ |✓
66+
|**Change length** |Length Optimization |Shorten or lengthen the text while preserving key information. The editor offers _Longer_ and _Shorter_ options. |✓ |✓
6767

6868
|**Adjust tone and style** |Tone Adjustment |Adjust tone and style. The editor includes _Casual_, _Direct_, _Friendly_, _Confident_, and _Professional_ options. |✓ |✓
6969

70+
|**Custom review** |— |xref:tinymceai-review.adoc#custom-review-choose-review[Custom review]: custom prompt and model; streams like other reviews. |✓ |✓ (custom review calls endpoint)
71+
7072
| |Translation |Translate between languages with cultural adaptation. | |✓
7173
|===
7274

7375
[NOTE]
7476
====
7577
* A checkmark in the Editor UI column means that review type can appear in the Review sidebar when it is listed in xref:tinymceai.adoc#tinymceai_reviews[`tinymceai_reviews`].
76-
* Custom reviews (analysis defined with a prompt) are available through the xref:tinymceai-review.adoc#reviews-custom-reviews[Custom reviews (API)]. _Note: The same capability in the Review sidebar is coming soon._
78+
* xref:tinymceai-review.adoc#custom-review-choose-review[Custom review] is included in the Review sidebar by default. The xref:tinymceai-review.adoc#reviews-custom-reviews[Custom reviews (API)] section describes the REST endpoint used for the same streaming review flow.
7779
* Translation Review is API-only (not listed in the Review sidebar); see the xref:tinymceai-review.adoc#built-in-reviews[Translation row] in the table above. For translation from the editor, see **Translate** in xref:tinymceai-actions.adoc#quick-actions-reference-table[Quick Actions reference table].
7880
====
7981

82+
[[custom-review-choose-review]]
83+
== Custom review
84+
85+
The Review sidebar includes a **Custom review** category by default. A natural-language prompt can be entered, and an AI model can be selected when xref:tinymceai.adoc#tinymceai_allow_model_selection[`tinymceai_allow_model_selection`] allows it; the review runs from **Run**. The document is analyzed with streaming suggestions like xref:tinymceai-review.adoc#review-sidebar-and-built-in-reviews[built-in reviews]; **Run** remains disabled until the prompt is entered and a model is selected. To hide Custom review, remove `+'ai-reviews-custom'+` from xref:tinymceai.adoc#tinymceai_reviews[`tinymceai_reviews`].
86+
87+
[TIP]
88+
The backend uses the custom review call (`POST /v1/reviews/custom/calls`) with `content`, `prompt`, and `model` in the request body. After a run completes, **Retry** in the Review UI can re-run the last review with the same parameters for both system and custom reviews.
89+
8090
[[review-configuration]]
8191
== Configuration
8292

@@ -92,7 +102,7 @@ The Review plugin feature is built on top of the Reviews API, which provides RES
92102
Reviews use streaming output with Server-Sent Events for real-time feedback as suggestions are generated. Each review type is optimized for specific improvement tasks, providing consistent, high-quality analysis of text structure, style, and quality. Reviews provide specific, actionable recommendations for content improvement.
93103

94104
[[reviews-system-reviews-api]]
95-
=== System Reviews
105+
=== System reviews
96106

97107
System reviews are default review operations for common use cases, which each use the AI agent most suitable for their functionality. The API includes one endpoint for running system reviews, which is passed the review name.
98108

@@ -103,26 +113,26 @@ For endpoint details, request and response schemas, authentication, and streamin
103113
[[reviews-custom-reviews]]
104114
=== Custom reviews (API)
105115

106-
Integrators can also define custom reviews using the Custom Review API endpoint, which returns a output in a similar manner to system reviews but which takes a custom prompt to define the analysis behavior. Custom reviews can be as simple as checking for specific words or phrases, or as complex as applying a company style guide that includes business logic, specific terminology, and more.
116+
Integrators can also call the Custom Review API endpoint directly. It streams suggestions in the same way as system reviews but takes a custom `prompt` (and `model`) with document `content` in the request body. Custom reviews can be as simple as checking for specific words or phrases, or as complex as applying a company style guide that includes business logic, specific terminology, and more.
107117

108-
See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the endpoint, parameters, and examples.
118+
See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the endpoint, parameters, and examples.
109119

110-
The Review sidebar only exposes those built-in types for now; sidebar support for custom reviews is coming soon.
120+
Users can also run custom reviews directly from the editor through the xref:tinymceai-review.adoc#custom-review-choose-review[Custom review] category in the Review sidebar.
111121

112122
Custom reviews require the `ai:reviews:custom` permission in the JWT token.
113123

114124
[[reviews-streaming]]
115-
=== Streaming Responses
125+
=== Streaming responses
116126

117-
Reviews use Server-Sent Events (SSE) for real-time streaming results. See the xref:tinymceai-streaming.adoc[Streaming Responses guide] for detailed implementation information.
127+
Reviews use Server-Sent Events (SSE) for real-time streaming results. See the xref:tinymceai-streaming.adoc[Streaming responses guide] for detailed implementation information.
118128

119129
[[reviews-api-reference]]
120-
=== API Reference
130+
=== API reference
121131

122132
The https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] reference (interactive OpenAPI documentation) is the full source for endpoints, request and response schemas, authentication, system and custom review calls, worked examples, and streaming review responses.
123133

124134
[[related-features]]
125-
== Related Features
135+
== Related features
126136

127137
* xref:tinymceai-chat.adoc[AI chat]: For interactive discussions with document analysis and context.
128138
* xref:tinymceai-actions.adoc[Quick actions]: Shortcuts to individual AI operations on a selection or range (transformations, translation, chat, and custom actions).

modules/ROOT/pages/tinymceai.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,3 @@ The {pluginname} plugin provides the following {productname} commands.
140140

141141
include::partial$commands/{plugincode}-cmds.adoc[]
142142

143-

modules/ROOT/partials/commands/tinymceai-cmds.adoc

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[tinymceai-toggling-sidebars]]
2-
.Toggling the AI Chat and AI Review sidebars
2+
=== Toggling the AI Chat and AI Review sidebars
33

4-
AI Chat and AI Review use sidebars registered by the plugin. To show or hide them programmatically, use the core `+ToggleSidebar+` command (listed in the xref:editor-command-identifiers.adoc#miscellaneous-core-commands[Miscellaneous Core Commands] table), not a command defined by the TinyMCE AI plugin. Pass the sidebar identifier as the third argument:
4+
AI Chat and AI Review use sidebars registered by the plugin. To show or hide them programmatically, use the core `+ToggleSidebar+` command (listed in the xref:editor-command-identifiers.adoc#miscellaneous-core-commands[Miscellaneous Core Commands] table), not a command defined by the `+tinymceai+` plugin. Pass the sidebar identifier as the third argument:
55

66
* `+'tinymceai-chat'+` — AI Chat
77
* `+'tinymceai-review'+` — AI Review
@@ -18,3 +18,57 @@ tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-chat');
1818
// Open the AI Review sidebar
1919
tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-review');
2020
----
21+
22+
NOTE: These commands work regardless of xref:tinymceai.adoc#tinymceai_sidebar_type[`tinymceai_sidebar_type`] (`+'static'+` or `+'floating'+`). The `+ToggleSidebar+` event and `+queryCommandValue('ToggleSidebar')+` also behave the same for both sidebar types.
23+
24+
[[tinymceai-plugin-commands]]
25+
=== TinyMCE AI plugin commands
26+
27+
The xref:tinymceai.adoc[`tinymceai`] plugin registers the following editor commands. They mirror the Quick Actions and related UI: each invocation returns immediately while the plugin performs any network and UI work asynchronously.
28+
29+
[cols="2,2,3",options="header"]
30+
|===
31+
|Command |Third argument |Description
32+
33+
|`+TinyMCEAIQuickActionImproveWriting+` | |Runs the **Improve writing** quick action.
34+
|`+TinyMCEAIQuickActionContinueWriting+` | |Runs the **Continue writing** quick action.
35+
|`+TinyMCEAIQuickActionCheckGrammar+` | |Runs the **Fix grammar** quick action.
36+
|`+TinyMCEAIQuickActionMakeShorter+` | |Runs **Make shorter**.
37+
|`+TinyMCEAIQuickActionMakeLonger+` | |Runs **Make longer**.
38+
|`+TinyMCEAIQuickActionToneCasual+` | |Runs **More casual** tone.
39+
|`+TinyMCEAIQuickActionToneDirect+` | |Runs **More direct** tone.
40+
|`+TinyMCEAIQuickActionToneFriendly+` | |Runs **More friendly** tone.
41+
|`+TinyMCEAIQuickActionToneConfident+` | |Runs **More confident** tone.
42+
|`+TinyMCEAIQuickActionToneProfessional+` | |Runs **More professional** tone.
43+
|`+TinyMCEAIQuickActionTranslate+` |`+string+` |Runs **Translate** with the given language label (same string family as xref:tinymceai.adoc#tinymceai_languages[`tinymceai_languages`] `+language+` values).
44+
|`+TinyMCEAIQuickActionCustom+` |`+{ prompt, model }+` |Runs a custom quick action with the given prompt and model (same behavior as xref:tinymceai.adoc#tinymceai_quickactions_custom[`tinymceai_quickactions_custom`] preview actions).
45+
|`+TinyMCEAIQuickActionsExplain+` | |Opens Chat with the built-in **Explain** prompt.
46+
|`+TinyMCEAIQuickActionsSummarize+` | |Opens Chat with the built-in **Summarize** prompt.
47+
|`+TinyMCEAIQuickActionsHighlightKeyPoints+` | |Opens Chat with the built-in **Highlight key points** prompt.
48+
|`+TinyMCEAIChatPrompt+` |`+{ prompt, displayedPrompt? }+` |Opens the Chat sidebar if needed, then sends `+prompt+` to the back end. Optional `+displayedPrompt+` controls the label shown in the chat UI when it differs from the text sent to the model.
49+
|===
50+
51+
[NOTE]
52+
====
53+
Command names use the `+TinyMCEAIQuickActions…+` prefix (with an `+s+`) for **Explain**, **Summarize**, and **Highlight key points** — these map to the xref:tinymceai.adoc#tinymceai_quickactions_chat_prompts[chat prompts] submenu, not to standalone `+TinyMCEAIQuickAction…+` spellings.
54+
====
55+
56+
.Example: translate and custom quick action
57+
[source,js]
58+
----
59+
tinymce.activeEditor.execCommand('TinyMCEAIQuickActionTranslate', false, 'swedish');
60+
61+
tinymce.activeEditor.execCommand('TinyMCEAIQuickActionCustom', false, {
62+
prompt: 'Uppercase text',
63+
model: 'gpt-4.1'
64+
});
65+
----
66+
67+
.Example: chat prompt with a shorter label in the UI
68+
[source,js]
69+
----
70+
tinymce.activeEditor.execCommand('TinyMCEAIChatPrompt', false, {
71+
prompt: 'Explain the current selection in Klingon',
72+
displayedPrompt: 'Explain'
73+
});
74+
----

modules/ROOT/partials/configuration/tinymceai_options.adoc

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ These options configure the AI Chat sidebar, where users have interactive conver
180180

181181
Populates the sources menu with submenus of files and web resources. Users can select these sources as additional context for chat conversations.
182182

183-
Takes a function that returns a Promise resolving to an array of additional context source groups. Each group has `+label+`, optional `+icon+`, and `+sources+` array. Each source has `+id+`, `+label+`, and `+type+` (`+'web-resource'+` or `+'file'+`). A source's `+id+` is used to fetch its content via xref:tinymceai.adoc#tinymceai_chat_fetch_source[`tinymceai_chat_fetch_source`].
183+
Takes a function that returns a Promise resolving to an array of additional context source groups. Each group has `+label+`, optional `+icon+`, and `+sources+` array. Each source has `+id+`, `+label+`, and `+type+` (`+'web-resource'+` or `+'file'+`). A source's `+id+` is used to fetch its content through xref:tinymceai.adoc#tinymceai_chat_fetch_source[`tinymceai_chat_fetch_source`].
184184

185185
*Type:* `+Function+` (`+() => Promise<Array>+`)
186186

@@ -255,7 +255,7 @@ tinymce.init({
255255
[[tinymceai_chat_welcome_message]]
256256
=== `+tinymceai_chat_welcome_message+`
257257

258-
Customises the welcome message displayed in the Chat sidebar when starting a new conversation.
258+
Customizes the welcome message displayed in the Chat sidebar when starting a new conversation.
259259

260260
*Type:* `+String+`
261261

@@ -440,6 +440,7 @@ Array of custom actions rendered in the Custom submenu within the AI Quick Actio
440440
* `+prompt+`: The prompt sent to the AI
441441
* `+type+`: `+'action'+` or `+'chat'+`
442442
* `+model+`: Required for `+action+` type only
443+
* `+id+` (optional): Stable identifier for the custom action. When set, the same string can be listed in xref:tinymceai.adoc#tinymceai_quickactions_menu[`tinymceai_quickactions_menu`] so the action appears as its own top-level menu item instead of only inside the Custom submenu. The identifier can also be used in the xref:menus-configuration-options.adoc#menu[`+menu+`] option or any other menu configuration that accepts menu item identifiers.
443444

444445
*Type:* `+Array+` of `+Object+`
445446

@@ -474,6 +475,39 @@ tinymce.init({
474475
});
475476
----
476477

478+
.Example: custom actions as top-level Quick Actions menu items using `+id+`
479+
[source,js]
480+
----
481+
tinymce.init({
482+
selector: 'textarea',
483+
plugins: 'tinymceai',
484+
toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review',
485+
tinymceai_quickactions_menu: [
486+
'ai-quickactions-chat-prompts',
487+
'ai-quote',
488+
'ai-summarize'
489+
],
490+
tinymceai_quickactions_custom: [
491+
{
492+
id: 'ai-quote',
493+
title: 'Add a quote from a famous person',
494+
prompt: 'Add a quote from a known person, which would make sense in the context of the selected text.',
495+
type: 'action',
496+
model: 'gemini-2-5-flash'
497+
},
498+
{
499+
id: 'ai-summarize',
500+
title: 'Summarize in 5 bullet points',
501+
prompt: 'Summarize the selected text in 5 bullet points.',
502+
type: 'chat'
503+
}
504+
],
505+
tinymceai_token_provider: () => {
506+
return fetch('/api/token').then(r => r.json());
507+
}
508+
});
509+
----
510+
477511
[[options-review]]
478512
== Options for Review
479513

@@ -493,6 +527,9 @@ Array of review command IDs that define which review types appear in the Review
493527
* `+'ai-reviews-improve-readability'+`: Adjust sentence structure and word choice
494528
* `+'ai-reviews-change-length'+`: Shorten or lengthen text
495529
* `+'ai-reviews-change-tone'+`: Modify tone and style
530+
* `+'ai-reviews-custom'+`: xref:tinymceai-review.adoc#custom-review-choose-review[Custom review] — accepts a prompt and model, then runs the same streaming preview and apply flow as other reviews
531+
532+
To hide Custom review from the Review sidebar, omit `+'ai-reviews-custom'+` from the array.
496533

497534
*Default value:*
498535
[source,js]
@@ -502,7 +539,8 @@ Array of review command IDs that define which review types appear in the Review
502539
'ai-reviews-improve-clarity',
503540
'ai-reviews-improve-readability',
504541
'ai-reviews-change-length',
505-
'ai-reviews-change-tone'
542+
'ai-reviews-change-tone',
543+
'ai-reviews-custom'
506544
]
507545
----
508546

0 commit comments

Comments
 (0)