Skip to content

feat: started working on category colors#254

Merged
ErikBjare merged 6 commits intomasterfrom
dev/category-colors
Feb 22, 2021
Merged

feat: started working on category colors#254
ErikBjare merged 6 commits intomasterfrom
dev/category-colors

Conversation

@ErikBjare
Copy link
Copy Markdown
Member

@ErikBjare ErikBjare commented Feb 7, 2021

Lets users set colors on categories, and uses them for various visualizations.

Closes ActivityWatch/activitywatch#416

TODO

  • Make more visualizations use the new coloring logic
  • Rewrite color.js to TypeScript
  • Add basic Vuex test example
  • Figure out how the upgrade process will work (where people have existing categories without data.color set)
  • Which colors should be set as default for the default categories?
  • Add a color picker/palett?
  • Fix all TODO comments

Preview

Not a great deal of variety, but the basics are there (haven't done much else than work on ActivityWatch since I started the testing server...)

image

Update: Barchart now looks great too!

image

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 7, 2021

Codecov Report

Merging #254 (7996291) into master (23b2074) will increase coverage by 9.46%.
The diff coverage is 34.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage    4.43%   13.89%   +9.46%     
==========================================
  Files          21       22       +1     
  Lines         969     1036      +67     
  Branches       94      101       +7     
==========================================
+ Hits           43      144     +101     
+ Misses        869      847      -22     
+ Partials       57       45      -12     
Impacted Files Coverage Δ
src/util/time.js 0.00% <0.00%> (ø)
src/util/transforms.js 0.00% <0.00%> (ø)
src/visualizations/summary.js 0.00% <0.00%> (ø)
src/visualizations/sunburst-clock.js 0.00% <0.00%> (ø)
src/visualizations/timeline-simple.js 0.00% <ø> (ø)
src/visualizations/timeline.js 0.00% <ø> (ø)
src/store/modules/activity.ts 6.10% <6.66%> (+6.10%) ⬆️
src/queries.ts 15.94% <33.33%> (+15.94%) ⬆️
src/util/color.ts 36.73% <62.50%> (ø)
src/util/classes.ts 80.30% <76.92%> (-0.83%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23b2074...7996291. Read the comment docs.

@ErikBjare ErikBjare force-pushed the dev/category-colors branch from 33a8bd8 to 37f292e Compare February 7, 2021 15:54
@johan-bjareholt
Copy link
Copy Markdown
Member

Figure out how the upgrade process will work (where people have existing categories without data.color set)

Upon page load, iterate over each category and simply set it if it's not already set?

@ErikBjare
Copy link
Copy Markdown
Member Author

I also wrote a basic test for the categories vuex module! (after some fiddling with the test config)

Should increase the code coverage somewhat, and make it easier to add more vuex tests.

@ErikBjare
Copy link
Copy Markdown
Member Author

ErikBjare commented Feb 22, 2021

There are a few more things before this is ready to ship, but it's by and large done (and really great!).

Merging since I also want to ship #162 in the same release and I want to rebase on top of this.

Moving remaining tasks to an issue.

@ErikBjare ErikBjare merged commit 86b8eab into master Feb 22, 2021
@ErikBjare ErikBjare deleted the dev/category-colors branch February 22, 2021 12:16
@NicoWeio NicoWeio mentioned this pull request Mar 28, 2021
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.

Add colors to categorization rules

2 participants