Add emoji picker to menubar (Fixes: #987) - #1707
Conversation
This comment has been minimized.
This comment has been minimized.
Yes, that one is indeed a bit tricky. The reason I went for the array instead of having the buttons directly in the component is that this allows to do some straight forward subset for rendering the popovermenu if the space exceeds the width. I might need to think about that a bit more. |
|
And I think a rebase is probably needed... |
dc7dec8 to
25c17ee
Compare
After thinking about it a second time, I'm more confident with my solution of special-treating the EmojiPicker in the for-loop. Beware though that the way I implemented it results in the EmojiPicker being always displayed as the last non-hidden tool. That's on purpose, given that adding an emoji would require three clicks otherwise (open popovermenu, open emojipicker, select emoji). Let me know what you think about it :) |
We could probably have a dedicated component with a slot that takes all the actions and then does conditional rendering based on the slot elements but not fully sure if that would be successful. Something similar how it is done in the actions component https://github.com/nextcloud/nextcloud-vue/blob/master/src/components/Actions/Actions.vue#L649 |
|
Anyways I'd be fine with the current workaround for now. Doesn't seem too bad ;) |
To be honest, I'm not sure whether it's worth the effort at the moment 馃槈. But you decide. If you'd like it to be that way, I'd give it a try.
Yay 馃槉 Feel free to approve/merge. I just changed the PR from draft to ready to merge. |
|
Rebased on latest master. |
|
馃槏 |
|
Awesome contribution @mejo- 馃憦 |
Summary
This is a first attempt to add the emoji picker to the text editor menubar. It works for me, but still has some rough edges.
Here's a screencast:
I'm curious to hear your thoughts @juliushaertl and @azul 馃槉
The way menu actions are organized in
src/mixins/menubar.jsat the moment unfortunately is a bit limited. Since the emoji picker isn't a simple<button>or<ActionButton>element and I prefer to reuse the<EmojiPicker>component from nextcloud-vue, I went a different route: I added the emoji action insrc/mixins/menubar.jsbut special-treated it in theMenuBarcomponent. I'm not particularly happy with this approach though. Maybe you have a better idea for a clean implementation?