Fix dark mode timeline colors #705
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the dark mode's timeline colors as mentioned in #611 : too small events are displayed in black, giving the impression that no events at all occurred at that time. In the screenshot below, look at the right of the timeline :
before : lots of apparently empty time slots :

after : the events now appear correctly :

The problem was that too short events weren't appearing because rendered too small (0~1px width) and since the
border-colorwas forced to dark grey by thedark.cssfile, the colors of the category that is applied to each event doesn't show. That grey border makes those events like "hidden".The fix is to prevent the border override to apply to the events.
The css code of the fix is not the most beautiful, but the underlying problem is a quite old css rule (4 years old) that is too generic (
#visualization *targets almost everything, this is bad) and that uses the!importantkeyword (this is very bad too ! 😄😅) :https://github.com/ActivityWatch/aw-webui/blame/f38b119f0ad628dd8af6ddfaaaf89700b9290c06/static/dark.css#L173-L177
A nicer solution would be to remove this rule and rework dark mode styling from the ground up but this quick fix should be sufficient for now I hope 🙏
Important
Fixes dark mode timeline border color by modifying CSS selector in
dark.css.dark.css, modifies#visualization *selector to exclude elements with inlineborderorborder-colorstyles, preventing unwanted border color application.This description was created by
for cd045c8. You can customize this summary. It will automatically update as commits are pushed.