Skip to content

MR : Weekly Performance Tracker UI Optimization

Bikkumalla Sai Krishna requested to merge weekly_ui_fix into dev

MR Description: Weekly Performance Tracker UI Optimization Overview: This Merge Request resolves a critical UI layout issue in the Weekly Performance Tracker where selecting a custom date range longer than 7 days caused the grid to collapse and metrics to overlap. Additionally, it increases the overall project test coverage to meet the 70% requirement.

Technical Changes

  1. UI Layout Fixes (weekly_performance.py) Horizontal Scroll implementation: Replaced the constrained flexbox layout with a robust inline-block scrolling model. This ensures that daily columns maintain a fixed width (220px) and overflow into a horizontal scrollbar rather than squashing their content. Scoped Styling: Utilized a marker div and the CSS :has() pseudo-class to ensure layout changes are strictly limited to the performance grid, preventing side effects in other parts of the application. Card Optimization: Reduced min-width of internal components to 200px to fit perfectly in the new compact view. Adjusted font sizes for metric labels and values to maintain legibility. Forced white-space: nowrap on summary titles to prevent vertical stretching. Audio Logic Fix: Resolved a Python for-else indentation error that was causing st.audio to crash with an "Invalid binary data format" error.

  2. Test Coverage Improvements New Coverage Tests: Created tests/test_weekly_performance_coverage.py to target previously untested UI rendering functions, including summary cards, activity slots, and selectors. Mock Refactoring: Updated tests/test_weekly_performance_ui_extended.py to correctly handle the new st.container context managers, resolving a regression in the existing test suite. Result: Successfully increased the total project coverage to 70.46%, passing the pre-commit gates. Validation Results Visual Check: Confirmed that 7 days fit on a standard screen, while 15+ days scroll smoothly without any overlapping cards. Functionality: Verified that audio contribution players load and play correctly. Automated Tests: All 297 tests passed with 70%+ coverage.

closes: #2 (closed)

Merge request reports

Loading