Skip to content

Extract chart trend logic and split StatusBarManager.updateButton#110

Merged
KyleNesium merged 1 commit intomainfrom
refactor/code-quality-phase2
Mar 14, 2026
Merged

Extract chart trend logic and split StatusBarManager.updateButton#110
KyleNesium merged 1 commit intomainfrom
refactor/code-quality-phase2

Conversation

@KyleNesium
Copy link
Owner

Summary

  • Extract ~150 lines of trend computation from ActivityChartView (678→526 lines) into ActivityChartTrend.swift — pure comparison logic and shared formatting helpers
  • Split StatusBarManager.updateButton (81 lines) into 6 focused methods, each under 10 lines
  • Make compactCount and formatHourLabel internal for cross-file access

Test plan

  • CI passes (build + 434 tests)
  • Trend summaries display correctly for all 3 chart modes (12H, 7D, 12M)
  • Collapsed chart header still shows vs-yesterday change indicator
  • Menu bar icon updates correctly (color, breathing, countdown, staleness)

…ed methods

- Extract ~150 lines of trend computation from ActivityChartView (678→526 lines)
  into ActivityChartTrend.swift: ActivityTrendComputation enum with pure comparison
  logic (vs yesterday, vs last week, vs last month) and shared formatting helpers
- Split StatusBarManager.updateButton (81 lines) into 6 focused methods:
  resolveMetricMode, resolveStarColor, updateSparkleState, updateRenderState,
  updateBreathTimer, resolveDisplayText — each under 10 lines
- Make compactCount and formatHourLabel internal for cross-file access
@KyleNesium KyleNesium merged commit 5012332 into main Mar 14, 2026
1 check passed
@KyleNesium KyleNesium deleted the refactor/code-quality-phase2 branch March 14, 2026 11:09
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