aw-webui icon indicating copy to clipboard operation
aw-webui copied to clipboard

feat: add productivity score for categories

Open ErikBjare opened this issue 4 years ago • 4 comments

Rebased and salvaged #162

Shouldn't require any changes to backend code.

Tasks

  • [ ] Review what would make the best UX from previous discussions
  • [ ] How long you need to engage in a 1 point activity to get 1 point? (an hour?)
  • [x] Add computation of score for period
    • totalScore = 0
      for event in events:
        totalScore += event.duration * get_score(event.category, allCategories)
      return totalScore / (60 * 60)  # from score-seconds to score-hours
      
  • [x] Add visualization (just a number of the total score today?)
  • [x] Make sure score is inherited correctly
  • [ ] What should scores be for the default categories?

ErikBjare avatar Feb 22 '21 12:02 ErikBjare

Codecov Report

Patch coverage has no change and project coverage change: -0.32 :warning:

Comparison is base (af12a54) 24.53% compared to head (ff9ecab) 24.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #258      +/-   ##
==========================================
- Coverage   24.53%   24.22%   -0.32%     
==========================================
  Files          27       27              
  Lines        1520     1540      +20     
  Branches      248      251       +3     
==========================================
  Hits          373      373              
- Misses       1122     1142      +20     
  Partials       25       25              
Impacted Files Coverage Δ
src/main.js 0.00% <0.00%> (ø)
src/stores/activity.ts 30.24% <0.00%> (-0.78%) :arrow_down:
src/stores/categories.ts 50.00% <0.00%> (-5.56%) :arrow_down:
src/util/classes.ts 81.18% <ø> (ø)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Feb 22 '21 12:02 codecov[bot]

How long you need to engage in a 1 point activity to get 1 point? (an hour?)

I never thought of it in that way at all.

Since you can do productive things outside of using your computer, to me it's more important to give a score of how productive you are on average rather than a sum of all your productive time. So rather than to just say a number "Todays productivity score was 800", I had always imagined a scale from -1 to 1 which could in text say "Very productive" if it's for example above 0.7 or something.

johan-bjareholt avatar Feb 22 '21 17:02 johan-bjareholt

@johan-bjareholt I think the current way is essentially identical to your way, except that the final value is unbounded. The current formula essentially returns a score-weighted average, where the scores can be both negative and positive depending on what the scores the user sets, so user more productive -> total score increases, user unproductive -> total score decreases.

If we want to bound the value, we can pass it through a tanh(total_score) function, which will map the values to [-1,1].

image

nicolae-stroncea avatar Feb 22 '21 17:02 nicolae-stroncea

I added a really quick-n-dirty visualization in the latest commit:

image

ErikBjare avatar Mar 24 '21 16:03 ErikBjare

Finally merging this. The remaining tasks will have to wait for another day.

ErikBjare avatar May 15 '23 12:05 ErikBjare