Игорь Надеин
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-13 15:02:20 +03:00
2025-09-09 17:55:15 +03:00
2026-01-09 14:48:43 +03:00
2026-01-05 11:20:56 +03:00
2026-01-12 17:21:41 +03:00
2026-01-13 15:02:20 +03:00
2026-01-09 14:56:44 +03:00
2026-01-09 14:14:01 +03:00
2026-01-08 16:14:00 +03:00
2026-01-09 14:48:43 +03:00
2025-11-20 09:00:55 +03:00
2025-07-30 08:15:53 +03:00
2026-01-13 10:19:26 +03:00
2025-12-03 12:59:12 +03:00
2026-01-09 16:57:48 +03:00
2026-01-13 15:02:29 +03:00
2025-09-11 17:56:33 +03:00
2026-01-13 15:36:17 +03:00
2026-01-13 15:02:20 +03:00
2026-01-13 15:02:29 +03:00
2025-07-30 08:15:53 +03:00
2026-01-05 10:47:56 +03:00
2026-01-08 16:14:00 +03:00
2025-11-20 09:00:55 +03:00
2025-09-03 17:17:44 +03:00
2025-07-30 08:15:53 +03:00
2026-01-05 07:41:34 +03:00
2026-01-05 07:41:34 +03:00
2026-01-08 16:14:00 +03:00
2026-01-06 07:48:04 +03:00
2026-01-08 16:55:54 +03:00
2026-01-09 15:07:55 +03:00
2026-01-13 09:18:25 +03:00