Allow book owner to set AI use
Context
Currently users can turn on/turn off AI use in each chapter of the book. This action can be taken by any user who has edit access to the chapter. This makes it challenging to implement an ‘AI use’ policy. Instead, the book owner should be able to control AI use.
One use case is the BookSprint team who need to be able to control when writing with AI is possible, otherwise the facilitated sessions would be difficult to manage.
Proposal
- Move AI switch to the book level so it’s set by the book owner. This requires a space for book settings.
- Add an icon to the editor toolbar that allows a user to choose when they want a prompt. The current implementation shows a prompt whenever text is select which is very distracting.
- When AI toggle is off, there is no AI icon available in the editor toolbar
There's a limitations to be aware of:
In order to change the tools available in the tool bar, Wax needs to re-render. Since this happens on the Producer page (the setting is an a modal), it affects the user experience because the page refreshes and users will be directed to the top the page.
To cater for this:
- only refresh the page for the book owner
- if other collaborators have a chapter open and the "Use AI" setting is turned on, they won't see the toolbar update until they navigate to another chapter (or away from the current chapter, then return)
- if other collaborators have a chapter open and the "Use AI" setting is turned off, the same point above applies, and if they try to use the AI pen tool, then they will see an error message "AI use has been disabled by the book owner", after which the page is refresh and the toolbar is updated.
This is okay for now, we'll review the flow for improvements when we get to implementing #637.
Design
New modal from Book settings icon:
For the AI writing icon on the editor toolbar, use:
For the settings icon in the app nav bar, use <SettingOutlined />
from Ant design
Implementation (if applicable)
Alternative approaches (if applicable)
[Include any alternatives to meet this use case.]