MVP AI tooltip in Wax editor
This issue is duplicated in wax/wax-prosemirror#71 (closed)
Context
On behalf of BookSprints we need to build AI functionality into Ketida 2. We already have demo AI functionality in a private CokoDocs demo site but need to expand on this significantly.
Ultimately, in terms of using AI within the editor (in the producer page of the Ketida 2 site), admins would like to set a list of prompts available for a user to make use of. For an MVP, we are not going to offer defined prompts, but rather let the user ask AI anything.
In order to give the authors maximum control, the AI generated text should not insert onto the page automatically, this should be a triggered action by the user (to replace or insert below) and they should also be able to discard the AI's suggestion or try again.
Proposal
User flow
- User select text
- An AI window appears which has a prompt field
- The user types in a prompt
- The user presses enter or clicks a send button (this could be words or an icon)
- The AI returns a response in the AI window, which visually replaces the prompt input area
- Below the AI response the user sees the following options:
- Replace current selection
- Insert below
- Try again
- Discard
- The user chooses an option, and the relevant action is executed:
- Replace current selection: deletes the selected text and inserts AI's response
- Insert below: keeps the selected text, adds a new paragraph below which includes the AI's response
- Try again: removes the previous AI response from the AI window, and generates a new AI response for which the user sees these same options
- Discard: closes the AI tooltip "modal"
Design
As on Figma