6 Commits

Author SHA1 Message Date
8c1e4f17a0 refactor: Extract teamWheel component (Phase 4 start)
- Created static/js/components/teamWheel.js (329 lines)
- Replaced 207-line inline script in department_scripts.html with ES6 module import
- Features: auto-scroll, manual control (mouse/touch/wheel), member focus, fallback
- All 12 tests passing
2025-10-28 09:28:06 +03:00
e1f9a4206f feat: create reusable CSS components (Phase 3)
- Created static/css/components/feed-cards.css (280 lines):
  * Comprehensive styles for feed/news cards
  * Classes: .feed-header, .feed-stream, .feed-card, .feed-hd, .feed-ava
  * Includes variants: compact, borderless, highlighted
  * Responsive design with mobile breakpoints
  * Replaces duplicated styles found in 6+ templates

- Created static/css/components/ios-search.css (160 lines):
  * iOS-style search component
  * Classes: .ios-search, .ios-search-input, .ios-search-clear
  * Size variants: sm, lg
  * Auto-showing clear button
  * Replaces duplicated styles found in 4+ templates

- Updated static/css/components/index.css:
  * Added imports for feed-cards.css and ios-search.css
  * Added import for variables.css
  * Provides single entry point for all CSS components

Benefits:
- Eliminates ~150 lines of duplicated CSS across templates
- Centralized styling for consistent UI
- Easy to maintain and update
- Uses CSS custom properties from variables.css
- Ready for use in new features

Next: Replace inline styles in templates with component imports

Tests: All 12 static file tests passing ✅
2025-10-28 08:48:13 +03:00
3e1e618a62 feat: create reusable ListFilter component (Phase 2.2)
- Created static/js/components/listFilter.js:
  * Universal list filtering component with search support
  * Replaces duplicated applyFilter() functions found in 7 templates
  * Features:
    - Configurable match functions (default or custom)
    - Debounced search input for performance
    - Support for data-attribute matching
    - Support for selector-based matching
    - Optional empty state message
    - Optional clear button
    - Flexible hiding methods (display/class)

- Updated static/js/components/index.js:
  * Exports ListFilter and helper functions
  * Added createDataAttrMatcher() helper
  * Added createSelectorMatcher() helper

Component ready for use in templates to replace inline applyFilter() implementations.

Tests: All 12 static file tests passing ✅

Next: Replace applyFilter() usage in templates with ListFilter component
2025-10-28 08:40:25 +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
c4998c709f Apply updates across all files in the repository 2025-10-20 17:08:40 +03:00