-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeline category colors #609
Timeline category colors #609
Conversation
This currently uses a slightly different strategy from where colors are used elsewhere
This allows doing something different for afk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to e196a24 in 16 seconds
More details
- Looked at
63
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_sICZrxzAXYYCxAZ3
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
I've also checked running tests, and they pass - though I haven't added new tests for this code:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good!
I might forget about this PR, but I'd love to see it merge, so do ping me when you're ready for review/merge!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #609 +/- ##
==========================================
- Coverage 26.13% 25.98% -0.15%
==========================================
Files 27 27
Lines 1630 1643 +13
Branches 273 292 +19
==========================================
+ Hits 426 427 +1
+ Misses 1178 1157 -21
- Partials 26 59 +33 ☔ View full report in Codecov by Sentry. |
@davidfraser I just tried this, and it works great on my machine. I think that it is a good solution to #604. I would be happy with merging something like it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to 6f5581b in 52 seconds
More details
- Looked at
48
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. src/util/color.ts:130
- Draft comment:
Loading classes on every call can be inefficient. Consider caching the result ofloadClasses()
to improve performance. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is misplaced as it refers to a potential optimization ingetCategoryColorFromString
, notgetCategoryColorFromEvent
. The comment should be associated with the function whereloadClasses()
is actually called. Since the comment is not relevant to the line it is placed on, it should be removed.
I might be missing the context in which the comment was added. Perhaps the tool mistakenly placed it on the wrong line, but the suggestion itself could still be valid for another part of the code.
Even if the suggestion is valid, it is not relevant to the line it is placed on. The comment should be removed from this location and potentially added to the correct location if necessary.
Remove the comment as it is not relevant to the line it is placed on. It refers to a different function and is misplaced.
2. src/util/color.ts:136
- Draft comment:
Consider documenting whygetColorFromString
is used forafkstatus
instead ofgetCategoryColorFromString
for consistency. - Reason this comment was not posted:
Confidence changes required:50%
ThegetCategoryColorFromEvent
function incolor.ts
usesgetCategoryColorFromString
for most cases, except forafkstatus
where it usesgetColorFromString
. This inconsistency should be clarified or documented.
3. src/visualizations/VisTimeline.vue:119
- Draft comment:
Consider implementing flooding or another method to handle short events for improved performance, as suggested by the TODO comment. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is suggesting a performance improvement based on a TODO in the code. However, the diff does not change the logic related to short events, so the comment is not directly related to the changes made in this PR. The comment is more of a suggestion for future work rather than a necessary change for this PR.
The comment might be useful for future improvements, but it does not address a specific issue in the current PR. It could be seen as informative rather than actionable for this specific change.
While the comment is informative, it does not point out a necessary change for the current PR. It is more of a suggestion for future consideration.
The comment should be removed as it does not address a necessary change in the current PR and is more of a suggestion for future improvements.
Workflow ID: wflow_TSTSzmbKpBbwET09
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Thanks @ErikBjare ! I'm happy with this from my side - just changed some quoting to please the linter - so shout with any other things you think should be addressed... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found one issue, but tbh I don't know what to do about it, so I'm going to just leave that comment there and maybe deal with it before release.
Thanks a lot for this contribution @davidfraser! ❤️ I must admit I am a bit shocked it was this easy the whole time, some excellent low-hanging fruit you picked! |
This is a first draft of supporting using category colors for the main Timeline view.
It still contains some verbose logging...
See ActivityWatch/activitywatch#573 which was a request for this which was closed stale, and #257 which listed it as follow-up work.
Summary:
Introduced category-based coloring for timeline events in
src/util/color.ts
and updatedsrc/visualizations/VisTimeline.vue
to apply these colors.Key points:
getCategoryColorFromEvent
insrc/util/color.ts
for category-based event coloring.src/visualizations/VisTimeline.vue
to usegetCategoryColorFromEvent
for event colors.currentwindow
,web.tab.current
,afkstatus
,app.editor
,general.stopwatch
.getCategoryColorFromString
for debugging.Generated with ❤️ by ellipsis.dev