Игорь Надеин
682714ba15
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
..
2026-01-05 14:38:06 +03:00
2026-01-13 09:18:25 +03:00
2026-01-13 15:02:20 +03:00
2026-01-13 09:18:25 +03:00
2026-01-13 15:36:17 +03:00
2025-11-28 13:07:17 +03:00
2026-01-13 15:24:38 +03:00
2026-01-13 15:36:17 +03:00
2025-11-20 09:00:55 +03:00
2025-12-29 10:15:45 +03:00
2026-01-13 09:18:25 +03:00
2026-01-13 15:02:29 +03:00
2026-01-13 10:14:11 +03:00
2026-01-13 14:35:49 +03:00
2026-01-13 14:35:49 +03:00
2026-01-13 15:02:29 +03:00
2026-01-13 15:02:29 +03:00
2026-01-12 17:37:41 +03:00
2026-01-12 11:11:02 +03:00
2025-11-28 10:09:23 +03:00
2025-12-01 14:19:58 +03:00
2025-12-01 14:19:58 +03:00
2025-11-20 18:52:29 +03:00