Игорь Надеин
4a4f3b2fa0
refactor: Clean architecture + unified badge styling
PART 1: Extract UnreadBadgeManager (Clean Architecture)
Created managers/unreadBadgeManager.js:
✅ Single Responsibility: Manages ONLY badge UI
✅ Methods: increment(), reset(), setCount(), hasUnread()
✅ Handles all DOM manipulation internally
✅ Reusable and testable
Cleaned ChatControllerV2:
❌ Removed 150+ lines of UI logic
❌ Removed duplicate systems (_unreadCount + _newMessagesCount)
❌ Removed deprecated methods:
- _incrementUnreadBadge()
- _resetUnreadBadge()
- _showNewMessagesIndicator()
- _hideNewMessagesIndicator()
- _findOrCreateNewMessagesButton()
✅ Now uses: this.badgeManager.increment/reset()
PART 2: Unified Badge Styling
Aligned unread-badge with sticky-date design:
- Same typography (font-size, weight, line-height)
- Same spacing (padding: 6px 12px)
- Same border-radius (10-12px)
- Same shadows (box-shadow hierarchy)
- Same transitions (0.2s ease)
- Same animation patterns (scale, hover effects)
- Added border: 2px for contrast with background
Result:
✅ Consistent UI across all badges
✅ Matches Telegram-like design system
✅ Better visual hierarchy
✅ ~950 lines in Controller (was 1125)
✅ Clean separation of concerns
2026-01-13 15:36:17 +03:00
..
2025-11-29 13:52:21 +03:00
2026-01-12 17:37:41 +03:00
2025-12-05 16:59:23 +03:00
2025-11-20 09:00:55 +03:00
2025-11-20 09:00:55 +03:00
2025-11-29 13:52:21 +03:00
2026-01-13 15:02:29 +03:00
2026-01-13 15:36:17 +03:00
2025-11-20 18:52:29 +03:00
2025-12-01 14:19:58 +03:00
2025-12-01 14:19:58 +03:00
2025-11-30 09:44:18 +03:00
2025-11-30 09:44:18 +03:00
2026-01-13 09:18:25 +03:00
2025-12-01 14:19:58 +03:00
2025-11-29 13:52:21 +03:00
2025-10-28 10:11:25 +03:00
2025-11-29 13:52:21 +03:00
2025-11-20 09:00:55 +03:00
2025-11-29 13:52:21 +03:00
2025-11-29 13:52:21 +03:00
2025-11-29 13:52:21 +03:00
2025-11-20 09:00:55 +03:00
2025-11-20 12:54:01 +03:00
2025-11-20 09:00:55 +03:00
2025-11-29 13:52:21 +03:00
2025-11-20 09:00:55 +03:00
2025-11-20 09:00:55 +03:00
2026-01-12 17:37:41 +03:00
2026-01-12 10:14:16 +03:00
2025-10-28 10:10:07 +03:00
2025-12-08 12:09:32 +03:00
2025-12-29 14:27:47 +03:00
2025-12-29 11:02:39 +03:00
2025-12-05 16:59:23 +03:00
2025-12-05 16:59:23 +03:00
2025-11-29 15:42:12 +03:00
2025-11-20 09:00:55 +03:00
2025-11-20 09:00:55 +03:00