Skip to content

Extract MenuBarIcon geometry and TokenHealthSection session helpers#111

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

Extract MenuBarIcon geometry and TokenHealthSection session helpers#111
KyleNesium merged 1 commit intomainfrom
refactor/code-quality-phase3

Conversation

@KyleNesium
Copy link
Copy Markdown
Owner

Summary

  • Extract star geometry helpers and NSBezierPath→CGPath extension from MenuBarIcon (502→379 lines) into MenuBarIconGeometry.swift
  • Extract session detail computation from TokenHealthSection (413→326 lines) into TokenHealthSessionInfo.swift as pure SessionInfoFormatter enum
  • All 5 previously-oversized view files now under 400 lines

File size results

File Before After
ActivityChartView 678 526 (Phase 2)
UsagePopoverView 665 665 (unchanged — state coupling)
MenuBarIcon 502 379
StatusBarManager 453 452 (Phase 2: method split)
TokenHealthSection 413 326

Test plan

  • CI passes (build + 434 tests)
  • Menu bar icon renders correctly (normal, breathing, broken, sparkle)
  • Context health section shows session info, tooltips, idle badges
  • Session toggle (chevron buttons, swipe gesture) still works

… helpers

- Extract star geometry helpers (starPath, brokenStarFragments, drawStroke)
  and NSBezierPath→CGPath extension from MenuBarIcon (502→379 lines) into
  MenuBarIconGeometry.swift (128 lines)
- Extract session detail computation (label parts, tooltip, idle detection,
  time formatting) from TokenHealthSection (413→326 lines) into
  TokenHealthSessionInfo.swift (102 lines) as pure SessionInfoFormatter enum
- All 5 previously-oversized view files now under 400 lines
@KyleNesium KyleNesium merged commit 1390499 into main Mar 14, 2026
1 check passed
@KyleNesium KyleNesium deleted the refactor/code-quality-phase3 branch March 14, 2026 15:05
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