Skip to content

fix: fixed Search view returning all events unfiltered, and converted component to typescript - #555

Merged
ErikBjare merged 1 commit into
masterfrom
dev/fix-search
May 1, 2024
Merged

ErikBjare merged 1 commit into
masterfrom
dev/fix-search

Conversation

@ErikBjare

Copy link
Copy Markdown
Member

Should convert the rest of the components to ts too.

@ErikBjare
ErikBjare merged commit 3a6a218 into master May 1, 2024
@ErikBjare
ErikBjare deleted the dev/fix-search branch May 1, 2024 09:58
TimeToBuildBob added a commit to TimeToBuildBob/aw-webui that referenced this pull request Sep 27, 2026
… hover color

dark.css overrides the hovered uncategorized bar fill (rgb(184,184,184) ->
ActivityWatch#555 !important), so picking label colours from the raw hover color produced
dark labels on the dark themed bar. Reuse the computed-style readback already
used on mouseout for the mouseover path (shared helper).

Git-Session-Id: 130d3e4b-eec6-5fcb-b7ab-fbc00b18e391
ErikBjare pushed a commit that referenced this pull request Oct 6, 2026
* fix(dark-mode): restore appsummary bar-chart label contrast

The generic 'svg text { fill: #fff !important }' rule forces white text on
ALL SVG elements including bar-chart labels in the appsummary component.
For light-colored bars (#FFE082 yellow, #90CAF9 light blue, #EF9A9A pink,
#A5D6A7 green) this produces white-on-light with failing WCAG contrast.

Add a scoped exception matching the timespiral pattern already in dark.css:
unset the fill override for appsummary text so labels fall back to the
component's own fill or SVG default (black), which is readable on both
light and dark bar backgrounds.

Closes #412

Git-Session-Id: d3f6

* fix(dark-mode): outline appsummary labels instead of unsetting fill

fill: unset made labels black, which is illegible on dark bars and on
the dark background when a short bar ends before its label does.
Keep white fill and add a dark paint-order:stroke outline so labels
read on light bars, dark bars, and background alike.

Git-Session-Id: d4b04a47-4fb8-5017-913a-9cf2f4330639

* fix(summary): colour bar labels by bar luminance, split overflow text

Replace the dark-mode stroke outline with a structural fix in summary.ts:
each label is drawn twice, once clipped to the bar (dark or light text,
whichever contrasts better with the bar colour) and once clipped to the
remaining width (default text colour, themed by dark.css for the page
background). Labels that overflow short bars stay readable in both themes
without outlines or text-shadow on the bar.

Reverts the dark.css appsummary text override.

Git-Session-Id: ec72

* fix(summary): use textColor for in-bar duration to guarantee WCAG AA contrast

The inBarColors helper used durationColor (#444) for the duration label when
dark text was chosen. On borderline bar colours where #333 just clears the
4.5:1 AA threshold, #444 could fall short. Use textColor (#333) for both name
and duration in the dark-text branch so the contrast guarantee is the same for
both labels.

Git-Session-Id: 19a84a06-0c5b-5834-91cc-5c41a80c4dae

* fix(summary): post-render pass to correct label colour after dark-mode CSS overrides; aria-hidden on visual text copies

Git-Session-Id: 347544d9-d4b9-52ca-a959-71c5eb10b5ac

* fix(summary): filter zero-duration apps; keep in-bar label colours correct across hover

P1 (ced6c2c4c7bf): extend the duration filter to also reject duration === 0.
A zero-duration app produced widthPct=0 and clipOut covering the full bar
width, drawing both label copies in the same region with conflicting fills.

P2 (14a715afce66): move clipIn/clipOut id definitions before the hover
handlers so they can be referenced in those closures.  mouseover now updates
in-bar label colours to contrast against the hover fill; mouseout schedules a
requestAnimationFrame pass that re-reads the actual CSS-computed fill
(accounting for theme overrides) and restores the correct in-bar colour.
This ensures the label colours stay accurate even when a rAF fires during a
hover and when CSS (e.g. dark.css) overrides the raw appcolor.

Git-Session-Id: d67ea75f-ed61-5b13-a770-59cfac0e87b2

* fix(summary): rename shadowed _ params to satisfy no-shadow lint

Git-Session-Id: 7fda0260-02b0-5ec4-b1a4-c9c66ceac41a

* fix(summary): guard empty app list after zero-duration filter

Git-Session-Id: d4f1421c-a125-55b7-9b4b-e43da08db21d

* fix(summary): derive hover label colours from displayed fill, not raw hover color

dark.css overrides the hovered uncategorized bar fill (rgb(184,184,184) ->
#555 !important), so picking label colours from the raw hover color produced
dark labels on the dark themed bar. Reuse the computed-style readback already
used on mouseout for the mouseover path (shared helper).

Git-Session-Id: 130d3e4b-eec6-5fcb-b7ab-fbc00b18e391
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.

1 participant