fix(ui): trend chart gradient area renders solid black (rant 2026-08-24T12:32:18) - #138
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fix the point-trend chart gradient area rendering as a solid black block on the transactions page (rant 2026-08-24T12:32:18).
Root cause: the
<linearGradient><stop>elements used CSS classes (.tg-0/.tg-1) to setstop-color/stop-opacity. These are SVG presentation attributes and Chrome's support for styling<stop>via external CSS classes is unreliable — the stops rendered colorless, sofill=url(#...)fell back to the default solid black. This existed since v0.7.13 (PR #133); PR #136 only changed colors, not the mechanism.Fix (mirrors the dashboard sparkline, which renders correctly):
<stop>s now carry inlinestop-color/stop-opacityattributes (0.35→0), per-metric dynamic color: spend=var(--accent), income=var(--ok), net=var(--accent-text), tokens=var(--warn)spark-grad-N, shared_sparkIdcounter) — prevents stale-id residue on metric switch / multi-chartfill="url(#<gid>)", line path gets inlinestroke(curve color == area color for every metric).tg-0/.tg-1/.m-*CSS rules from style.cssCache-bust
20260824-5→20260824-6.Tests
cargo test146/146,cargo fmt --check,cargo clippyall greennode --check+ JS smoke test: all 4 metrics produce unique gid, inline stops, inline fill/stroke