text icon indicating copy to clipboard operation
text copied to clipboard

Feature: Show word count in RichText

Open susnux opened this issue 3 years ago • 9 comments

  • 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.

susnux avatar Jul 04 '22 12:07 susnux

/compile

susnux avatar Jul 04 '22 12:07 susnux

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: Screenshot 2022-07-04 at 14 09 37

Screenshot 2022-07-04 at 14 07 58

@jancborchardt What do you think?

Dropbox Paper for example also has a separate context menu for the document itself: Screenshot 2022-07-04 at 14 10 37

susnux avatar Jul 04 '22 12:07 susnux

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 avatar Jul 04 '22 12:07 susnux

@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.

vinicius73 avatar Jul 04 '22 12:07 vinicius73

/compile amend

susnux avatar Jul 14 '22 13:07 susnux

/compile amend

susnux avatar Jul 18 '22 07:07 susnux

/compile amend

susnux avatar Sep 13 '22 18:09 susnux

@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.

susnux avatar Sep 13 '22 18:09 susnux

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.

max-nextcloud avatar Sep 15 '22 07:09 max-nextcloud

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:

grafik

mejo- avatar Oct 04 '22 11:10 mejo-

/compile

mejo- avatar Oct 04 '22 11:10 mejo-

/compile

mejo- avatar Oct 04 '22 11:10 mejo-

:+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.

susnux avatar Oct 04 '22 11:10 susnux

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.

mejo- avatar Oct 04 '22 11:10 mejo-

Yes I think this is ok, just wanted to mention this as it might be confusing.

susnux avatar Oct 04 '22 12:10 susnux

Thanks for continuously pushing the test fix and big sorry for overwriting it several times @susnux :grimacing:

mejo- avatar Oct 04 '22 12:10 mejo-

/rebase

mejo- avatar Oct 05 '22 07:10 mejo-

/compile

mejo- avatar Oct 05 '22 09:10 mejo-

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!

adrienneteicher avatar Dec 07 '22 11:12 adrienneteicher

Hey @adrienneteicher. Which Nextcloud version do you use? The feature is only available starting with Nextcloud 25.

mejo- avatar Dec 07 '22 11:12 mejo-

3.5.1 is the version used on Nextcloud 24. So you would have to upgrade to Nextcloud 25 to get this feature.

susnux avatar Dec 07 '22 11:12 susnux

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: @.***>

adrienneteicher avatar Dec 07 '22 12:12 adrienneteicher