d5be62b34c
refactor: восстановлены старые стили пузырей сообщений, аватаров и разделителей (pre-redesign)
...
- Восстановлен мягкий цвет пузырей: color-mix(92%) вместо жесткого var(--bs-primary)
- Аватары: border-radius 9999px + grid layout для идеальных кругов
- Разделители: правильный spacing, font-weight 700, pointer-events, color-mix прозрачность
- Добавлены оптимизации скролла: rootMargin 300px, limit 50 сообщений (Telegram-стиль)
- Добавлены новые модули: messageLoader, scrollManager, chatUtils
- Рефакторинг логики загрузки сообщений для предотвращения дубликатов
- Создана документация по архитектуре и тестированию
2026-01-12 17:21:41 +03:00
c3fd4916d1
refactor: extract JavaScript utilities to separate modules (Phase 2)
...
- Created reusable utility modules:
* static/js/utils/stringUtils.js - string operations (esc, norm, escAttr, truncate, getInitials)
* static/js/utils/timing.js - timing utilities (debounce, throttle, delay, poll, once)
* static/js/utils/scroll.js - scroll helpers (smoothScrollTo, scrollToTop, isElementInViewport, etc.)
- Updated static/js/utils/index.js:
* Exports all utilities from a single entry point
* Provides centralized access to all utility functions
- Modified base.html:
* Removed inline esc() and norm() function definitions
* Added ES6 module imports for utilities
* Exported utilities to window for backward compatibility
* All existing code continues to work without changes
Benefits:
- Eliminates code duplication (esc/norm found in 9 templates)
- Centralizes utility functions for easier maintenance
- Enables future improvements (testing, optimization)
- Maintains backward compatibility with existing templates
Tests: All 12 static file tests passing ✅
2025-10-28 08:37:02 +03:00
303fd54d17
feat: setup refactoring infrastructure (Phase 0)
...
- Created static file structure:
* static/css/components/ - reusable CSS components
* static/css/pages/ - page-specific styles
* static/js/utils/ - utility functions
* static/js/components/ - interactive components
- Created infrastructure files:
* static/css/variables.css - CSS custom properties
* static/css/components/index.css - CSS entry point
* static/js/utils/index.js - JS utilities entry point
* static/js/components/index.js - JS components entry point
- Added comprehensive tests:
* tests/test_static_files.py - 12 tests for structure, syntax, encoding
- Updated .gitignore:
* Added staticfiles/ to ignore list
* Clarified that static/ sources are tracked
- Added REFACTORING_PLAN.md:
* New strategy: extract CSS/JS before HTML decomposition
* Documented lessons learned from previous attempts
* Defined phases 0-6 for systematic refactoring
2025-10-28 08:29:43 +03:00