odoo/odoo#204723
Created by Discuss, Alexandre Kühn (aku)
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 1s)
- label
- odoo-dev:master-message_separator-aku
- head
- be82fdbd88e01296a7725afc78afaabcf2a364b9
- merged
- 6 months ago by Discuss, Alexandre Kühn (aku)
| odoo/odoo | odoo/enterprise | |
|---|---|---|
| saas-18.3 | #204723 | #83240 |
| saas-18.4 | ||
| 19.0 | ||
| master | #209289 | #85142 |
[IMP] mail: improved behaviour for counter and new msg separator
This commit improves behaviour of new message counter, msg separator and unread message banner in discuss conversation.
Before this commit, all these conditions were made with special fields syncUnread and passing sync param to mark_as_read rpc, so that the server acknowledges by providing the new_message_separator value.
This solution is very prone to race condition and the code is far too complicated and result to many misses, leading to end-user to manually click on mark as read very often and/or come back to conversation and/or page reload to have proper counters.
This commit improves by making the implementation much simpler by being fully client-side and more imperative. There's no more sync param acknowledgement, and instead the UI versions of counter and separator are mostly the same as the server values but soften in JS for UI concerns, i.e. don't increase counter if it becomes immediately decreased, or new message separator is a bit more persistent to not jump between messages all the time.
This implementation also improve behaviour of auto mark as read: before this commit, focus on composer was a hard requirement for this auto-mark as read. Now, soft-focus on thread is good enough, and scrolling to bottom with focus on either composer or thread is enough to mark the conversation as read.
This commit also makes these new improvements on new message separator:
- new message separator was always displayed on opening new conversation with only new messages. Now this is not displayed because all messages are new anyway. It displays a new message separator however when a new message is posted just after conversation is being displayed
- new message separator is shown above 1st message of conversation only when conversation is explicitly marked as unread from this message