feat(messages): sort group read status — read (earliest first), unread (alphabetical)
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-03-27 16:57:04 +01:00
parent 1a3db7cf14
commit 6eff4aad83
2 changed files with 10 additions and 1 deletions

View File

@ -652,6 +652,15 @@
if (isGroup) {
// Group: show per-member read status
// Sort: read (earliest first), then unread (alphabetically)
otherMembers.sort(function (a, b) {
var aRead = a.last_read_at && new Date(a.last_read_at) >= msgTime;
var bRead = b.last_read_at && new Date(b.last_read_at) >= msgTime;
if (aRead && !bRead) return -1;
if (!aRead && bRead) return 1;
if (aRead && bRead) return new Date(a.last_read_at) - new Date(b.last_read_at);
return (a.name || '').localeCompare(b.name || '', 'pl');
});
var lines = [];
otherMembers.forEach(function (m) {
var name = m.name || 'Użytkownik';

View File

@ -228,7 +228,7 @@ window.__CSRF_TOKEN__ = '{{ csrf_token() }}';
// Load conversations.js after data is set
(function() {
var s = document.createElement('script');
s.src = '{{ url_for("static", filename="js/conversations.js") }}?v=16';
s.src = '{{ url_for("static", filename="js/conversations.js") }}?v=17';
document.body.appendChild(s);
})();
{% endblock %}