fix(summary): outline dark-mode summary labels#891
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #891 +/- ##
==========================================
+ Coverage 35.59% 38.42% +2.83%
==========================================
Files 36 42 +6
Lines 2152 2225 +73
Branches 398 417 +19
==========================================
+ Hits 766 855 +89
+ Misses 1365 1349 -16
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
✅ Ready to merge
This is ready for a maintainer to merge. |
|
I think I tried this before, but it doesn't really work since the text overflows the bar which would make white text on white bg for the overflow. The way I "fixed" (improved) it was indeed by adding text-shadow (as ActivityWatch/aw-server-rust#621 suggests) but clearly it's not a complete fix, but neither is this (and the alternating white text vs black text depending on bar luminosity also looks off iirc). |
Dark mode forces SVG text to white globally, which makes app summary labels hard to read on light-colored bars. The previous per-bar luminosity approach did not handle labels that overflow outside the bar and made adjacent labels vary between white and dark text.\n\nKeep the existing label fill behavior and add a dark-mode-only outline scoped to the app summary SVG labels instead. The outline preserves readable white text both on light bars and when labels overflow past the bar.\n\nFixes ActivityWatch/aw-server-rust#621
adf8ff3 to
450df59
Compare
|
Agreed. The luminosity-based version was the wrong shape for this because the labels are not clipped to the bars, and alternating black/white labels looks noisy. I rewrote the PR: it now leaves Local checks passed:
GitHub CI is rerunning on the new commit now. |
|
@greptileai review |
|
All CI checks ✅ and Greptile review (5/5 confidence) now complete on the rewritten version (CSS outline approach). The rewrite addresses your concern about text overflow: instead of a luminosity-based approach that varies label colors (which looked noisy), this adds a dark-mode-only outline scoped to Ready to merge when you are. |
Problem
In dark mode,
dark.cssappliessvg text { fill: #fff !important }globally. The summary visualization renders app-name and duration labels over category-colored bars. On light-colored bars, white text can be hard to read.Reported in ActivityWatch/aw-server-rust#621.
Fix
Add a dark outline scoped to
svg.appsummary textinstatic/dark.cssusing SVG stroke properties:Testing
npm run lint -- --no-fix— passes, with existing no-shadow warnings invite.config.jsandvue.config.jsnpm run build— passes, with existing asset-size warnings and dependency deprecation warnings