New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add menu bar button for media embed. #16337
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe recent updates to the CKEditor5 packages primarily focus on enhancing the media embed functionality. Key changes include the replacement of dropdown elements with button and dialog components for media embedding, simplification of UI by removing unused buttons and focus management in forms, and adjustments to menu bar configurations and utilities to support these modifications. Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (4)
Files skipped from review due to trivial changes (1)
Additional comments not posted (5)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still several things to fix/improve:
- You should add the
Dialog
plugin torequires
inmediaembedui.ts
. - IMO, the dialog is too small. We could discuss it at the daily meeting.
- The dialog content does not clear after closing, resulting in the bug where the input label hovers over the starting input value (after reopening the modal):
Nagranie.z.ekranu.2024-05-16.o.09.33.42.mov
- Unit tests are still missing.
Ad 3. is still not fixed, I'm waiting for a decision about the way it will be handled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM. I tested it manually a bit and it looks good. Mostly minor changes except that it should be a centered modal.
/** | ||
* Creates a button for for menu bar that will show find and replace dialog. | ||
*/ | ||
private _createDialogButton<T extends typeof ButtonView | typeof MenuBarMenuListItemButtonView>( ButtonClass: T ): InstanceType<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this type:
T extends typeof ButtonView | typeof MenuBarMenuListItemButtonView
I think I've seen this before in other menu bar related plugins but refrained from commenting then.
My question is. MenuBarMenuListItemButtonView extends ButtonView
so what is the point of having them both in T
declaration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, IMO that suggests the ways this function will be used, to emphasize that it will be called with both ButtonView
and MenuBarMenuListItemButtonView
, so just for better readability. Second, as you mentioned, I followed already established convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, do you confirm that from types perspective, it doesn't matter (at least in this case)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor thing. I'd change it myself but there may be a related unit test. If there's not maybe we should check how the modal is opened (with what params?)
Suggested merge commit message (convention)
Feature (media-embed): Added menu bar integration to media embed.
MINOR BREAKING CHANGE (media-embed): Media embed uses dialog instead of dropdown for inserting media.
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.