Feature: Show word count in RichText
- Resolves: #470, closes #2630
- Target version: master
Summary
Show word count as last element of the overflow menu, which now will be always shown. The word count is updated when the menu is openend as the tiptap word count is not reactive.
Modified ActionList: Added a named slot for adding elements that should always shown as the last elements.
What should be mentioned: This solution refreshes on menu open, but it is also possible to refresh it on content change. So the current solution do not introduce many unneeded calculations, but (and I am not sure if this is even possible) does not update the label if typing while the menu is open.
/compile
from https://github.com/nextcloud/text/pull/2630#issuecomment-1173746059 @juliushaertl
I'm a bit hesitant to add even more to the menu, especially on mobile. Also it is not fully related to the other actions which are more formatting actions that are targeting the current position/selection. To me it would be more suitable on the right hand side. Maybe we need to adapt the "collaborator" menu a bit to cover more details about the document in general.
For reference this is how it currently looks:


@jancborchardt What do you think?
Dropbox Paper for example also has a separate context menu for the document itself:

I implemented this as suggested in this comment https://github.com/nextcloud/text/issues/470#issuecomment-577464003 by @jancborchardt
But I noticed there are quite a lot of feature requests for implementing stuff that require new buttons. Maybe this should be discussed together with:
https://github.com/nextcloud/text/issues/2438#issuecomment-1134901533 and https://github.com/nextcloud/text/pull/2611#issuecomment-1164356890
@susnux I'm working in a "sidebar" (ouline) for text editor to wrap the Table Of Contents #107 Maybe we can use it to show word counter as well.
I have some visual issues, but I will open a PR and get some feedback from the team.
/compile amend
/compile amend
/compile amend
@jancborchardt affirmed this should go into the "..." menu: https://github.com/nextcloud/text/pull/2688#issuecomment-1184356837
So I think this is ready to go.
UI also looks okay to me. It looks somewhat funny when it's the only entry in the three dots menu. But i guess that's okay. We'll redesign the menubar anyway.
I rebased the PR to latest master and pushed a few additional changes. Hope you don't mind, @susnux.
After discussing with @jancborchardt we decided (and I implemented) to:
- Add an icon to the word count
- Alsow add character count
- Always move the formatting help under the three-dot-menu. That way the counts are never the only entry
Screenshot:

/compile
/compile
:+1:
The reason why I did not use ActionText but ActionCaption is that the latter one does not show a pointing cursor when hovering it. As there is no action behind the the text, so the action text is a bit confusing.
The reason why I did not use ActionText but ActionCaption is that the latter one does not show a pointing cursor when hovering it. As there is no action behind the the text, so the action text is a bit confusing.
I agree. At the same time, ActionCaption doesn't support an icon slot, so that's why I went with ActionText. I think, it's an acceptable tradeoff, don't you think so? Also, there's still no background change on hover, so it's different from the clickable menu entries.
Yes I think this is ok, just wanted to mention this as it might be confusing.
Thanks for continuously pushing the test fix and big sorry for overwriting it several times @susnux :grimacing:
/rebase
/compile
Hi all, This is just what I need but I don't see it in my version of the app. I am on 3.5.1 Is it that I should just be patient for updates? Thank you!
Hey @adrienneteicher. Which Nextcloud version do you use? The feature is only available starting with Nextcloud 25.
3.5.1 is the version used on Nextcloud 24. So you would have to upgrade to Nextcloud 25 to get this feature.
Thanks Patrizio. Yes, I am on Nextcloud 24. I have to wait for my provider to upgrade to 25.
On 07/12/2022 12:54, Ferdinand Thiessen wrote:
|3.5.1| is the version used on Nextcloud 24. So you would have to upgrade to Nextcloud 25 to get this feature.
— Reply to this email directly, view it on GitHub https://github.com/nextcloud/text/pull/2664#issuecomment-1340859345, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGYIPIGWVGIDTFYRKL64NDDWMB3JDANCNFSM52TAE5KQ. You are receiving this because you were mentioned.Message ID: @.***>