Conversation
fe9df97 to
e8d5908
Compare
d6678e4 to
9cb7f76
Compare
9cb7f76 to
b37e1c5
Compare
- Updated the AI Agent plugin to allow users to configure the command trigger string (currently hardcoded as '/') to better suit their preferences. - Introduced a new configuration option for the CMD+/ keyboard shortcut, enabling users to customize it according to their workflows and accessibility needs. - Modified the relevant code in `src/aiagentservice.ts`, `src/aiagentediting.ts`, and `src/const.ts` to support these new configurable options. - Updated the README.md to reflect the new configuration options and their usage. These enhancements improve the flexibility and user experience of the AI Agent plugin, allowing for a more tailored interaction with the editor. Closes #99
b37e1c5 to
10b9809
Compare
jjroelofs
left a comment
There was a problem hiding this comment.
Bug 1: default shortcut inline prompt
After checking out your branch, immediately the CMD+/ command it not working anymore. The Accessibility Help popup still shows this is the correct shortcut (and it should be):
Bug 2: AiKeyboard setting not working
Config:
aiKeyboard: '?',
UI after reloading, still showing /:

Furthermore, when I click the Accessibility Help button I get this error:
keyboard-unknown-key {"key":"?"}
Bug 3:
When I try to enter a Keyboard shortcut that is supported by CKEditor API: 'Ctrl+Alt+H' in the editor I get this error:
Type '"Ctrl+Alt+H"' is not assignable to type '"|" | "," | "." | "?" | ";" | ":" | "'" | "\"" | "+" | "-" | "=" | "_" | "\\" | "*" | "%" | "^" | "~" | "<" | ">" | "(" | ")" | "{" | "}" | "[" | "]" | "!" | "@" | "#" | "$" | "&" | undefined'.ts(2322)
I asked you to use CKEditor API so that we don't have these weird sort of bugs, CK5 has a reliable and user friendly keyboard API, no need to do double work. See a reference of their keyboard utilities here:
https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/keyboard.ts
https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/keystrokehandler.ts
| | `moderationDisableFlags` | `Array<ModerationFlagsTypes>?` | - | Array of moderation flags to disable | | ||
| | `commandsDropdown` | `Array<{ title: string; items: Array<{ title: string; command: string; }>; }>?` | Default menu with tone adjustment, content enhancement, and fix/improve commands | Specifies the commands available in the dropdown menu | | ||
| | `contentScope` | `string?` | - | CSS selector that extends context gathering to include content from other CKEditor 5 instances found within the first matching ancestor element | | ||
| | `aiKeyboard` | `AiKeyboardTypes?` | `/` | Specifies the type of AI keyboard interaction to be used within the editor. This option allows for customization of keyboard behavior related to AI functionalities, enhancing user experience by providing tailored input methods. | |
There was a problem hiding this comment.
Dont we need 2 settings here, one for normal prompt and one for inline prompt?
For example maybe for normal prompt I want to set:
Alt+H
and for inline prompt:
Ctrl+Alt+H
| ] as const; | ||
|
|
||
| export const AI_KEYBOARD_CODS = { | ||
| ',': 188, |
There was a problem hiding this comment.
We don't want to implement custom keystroke handling, leave it to CKEditor5 API, this is technical debt we do not want to take on. CK5 has figured out support for multiple OS, localization, lots of complexities we do not have the capacitity to figure out. Either we implement this using CK5 API or we do not implement it at all because we cannot afford to create and maintain the neccessary business logic to implement keyboard shortcuts reliably for a global user base.

src/aiagentservice.ts,src/aiagentediting.ts, andsrc/const.tsto support these new configurable options.These enhancements improve the flexibility and user experience of the AI Agent plugin, allowing for a more tailored interaction with the editor.
Closes #99