Skip to content

feat(dashboard): add real-time productivity score with color coding#197

Open
ronilaukkarinen wants to merge 1 commit intoJerryZLiu:mainfrom
ronilaukkarinen:feat/productivity-score
Open

feat(dashboard): add real-time productivity score with color coding#197
ronilaukkarinen wants to merge 1 commit intoJerryZLiu:mainfrom
ronilaukkarinen:feat/productivity-score

Conversation

@ronilaukkarinen
Copy link
Copy Markdown

Note

This feature was implemented using partly Claude Code. As I'm not a Swift expert, a code review would be appreciated, particularly around state management and the Combine observers in StatusBarController.

Summary

Adds a real-time productivity score (0-100) to the day summary panel and macOS menubar. The score provides instant feedback on daily productivity based on focused, neutral, and distracted time.

I added this because I stopped using Timing in favor of Dayflow and was missing its "productivity percent" in menubar.

SCR-20260123-lrep-2 SCR-20260123-nbbj-2 SCR-20260123-lrfz
SCR-20260123-nbce-2

What's changed

Productivity score calculation

  • Uses manual review data (focused/neutral/distracted ratings) when available for most accurate scoring
  • Falls back to automatic category-based calculation when no review data exists
  • Formula: Focused time × 100 + Neutral time × 50 + Distracted time × 0

UI improvements

  • Added productivity score card to "Your focus" section in day summary panel
  • Score displays with dynamic color coding

Menubar integration

  • Displays colored productivity score next to Dayflow icon in macOS menubar
  • Updates in real-time as you work throughout the day
  • Changed status item length from fixed to variable to accommodate score display

Technical details

  • Added productivityScore and hasProductivityData properties to AppState
  • Created ProductivityScoreCard component with conditional color styling
  • Updated StatusBarController to combine recording state and productivity score observables
  • Score updates automatically when review data or category assignments change

Testing

  • Score displays correctly with review data
  • Score falls back to category calculation when no reviews exist
  • Color coding updates based on score thresholds
  • Menubar shows colored score alongside app icon

Add productivity score (0-100) to day summary panel and menubar. Score is calculated from manual review data when available, with automatic fallback to category-based calculation. Score uses color coding: green (70+), orange (60-69), red (<60).

Changes:
- Add ProductivityScoreCard component to focus section
- Calculate score from focused/neutral/distracted ratios
- Display colored score in menubar next to app icon
- Add info tooltip explaining calculation method
- Store score in AppState for real-time updates
- Update StatusBarController to show variable-length status item
@WashedYirgacheffe
Copy link
Copy Markdown

awesome idea!

@ronilaukkarinen
Copy link
Copy Markdown
Author

Any plans for this, @JerryZLiu? This draft can be improved.

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.

2 participants