Skip to content

feat: enhance stats visualization with improved charts and time range selection#8

Merged
AndyBold merged 1 commit into
mainfrom
feat/stats-visualization-improvements
Feb 7, 2026
Merged

feat: enhance stats visualization with improved charts and time range selection#8
AndyBold merged 1 commit into
mainfrom
feat/stats-visualization-improvements

Conversation

@AndyBold

@AndyBold AndyBold commented Feb 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixed chart interpolation to use straight lines between data points instead of curved splines
  • Refactored duplicated chart code into reusable components for better maintainability
  • Fixed layout recursion warning during chart rendering
  • Improved DetailedStatsView performance by optimizing view update strategy
  • Added CLAUDE.md with project guidelines and common patterns

Changes

Chart Interpolation

  • Removed .interpolationMethod(.catmullRom) from all charts
  • Charts now use linear interpolation (straight lines) for accurate data representation
  • Applied to: CPU, Memory, Network I/O, and Block I/O charts

Code Refactoring

  • Created 4 reusable chart components:
    • CPUChart - configurable with height and showXAxis parameters
    • MemoryChart - configurable with height and showXAxis parameters
    • NetworkIOChart - configurable with height and showXAxis parameters
    • BlockIOChart - specific for detailed view with dual read/write lines
  • Eliminated ~200+ lines of duplicated code
  • Both main Stats view and DetailedStatsView now use the same chart components

Bug Fixes

  • Fixed layout recursion warning by using explicit axis configurations instead of conditional rendering
  • Fixed DetailedStatsView performance issue (2+ second pause) by using targeted .id() modifiers on individual sections instead of entire view hierarchy
  • Confirmed time range filtering works correctly - charts update based on selected time span

Documentation

  • Added CLAUDE.md with project guidelines including:
    • Critical SwiftUI patterns (label wrapping prevention)
    • Thread safety patterns
    • Code conventions
    • Git commit message format

Test Plan

  • Charts display with straight lines between data points
  • No layout recursion warnings in console
  • DetailedStatsView loads quickly without long pause
  • Time range selector properly updates charts
  • Charts display correctly on both main Stats view and DetailedStatsView

🤖 Generated with Claude Code

… selection

- Fix chart interpolation: use linear interpolation instead of catmullRom for accurate data representation
- Add time range picker with proper labels and fixed size to prevent wrapping
- Implement DetailedStatsView with larger charts and comprehensive metrics
- Refactor chart components into reusable views (CPUChart, MemoryChart, NetworkIOChart, BlockIOChart)
- Add proper chart updating when time range changes using .id() modifiers
- Fix layout recursion issues by using explicit axis configurations
- Add CLAUDE.md with project guidelines for consistent UI patterns
- Eliminate code duplication by creating shared chart components
- Fix Time Range picker label wrapping on both main and detailed views

All charts now display with:
- Straight lines between data points for accurate representation
- Proper time range filtering with visual updates
- Consistent styling across main and detailed views
- No UI freezing or layout warnings

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@AndyBold
AndyBold merged commit dac8fd8 into main Feb 7, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant