-
Notifications
You must be signed in to change notification settings - Fork 434
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
Limit unread message counter to "99+" #845
Conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
@@ -103,7 +103,8 @@ | |||
templateContext: function() { | |||
return { | |||
isDeletable: (this.model.get('participantType') === 1 || this.model.get('participantType') === 2) && | |||
(Object.keys(this.model.get('participants')).length > 1 || this.model.get('numGuests') > 0) | |||
(Object.keys(this.model.get('participants')).length > 1 || this.model.get('numGuests') > 0), | |||
numUnreadMessages: this.model.get('unreadMessages') > 99 ? '99+' : this.model.get('unreadMessages') |
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 think that the 99+
should be internationalized, as a different string could be needed (although I am not really sure) in languages that do not use Hindu-Arabic numerals or the plus sign.
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 quickly thought about it too, but I wouldn't know which language does not use + for +? :D
lets keep it until someone complains.
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.
Tested and works 👍
CSS is a copy of the server version now
Top is new (84445 is now 99+)
Bottom is old (number is cut off)
As per documentation https://docs.nextcloud.com/server/13/developer_manual/design/navigation.html#counter the counter should be limited to 3 digits, but I think for chat messages it does not matter anymore when it's over 100, so we display 99+ when it's more then 99
@Ivansss @mario we limit the number in the UI not the api, so maybe you can limit it too to 99+