Repository navigation
fix(shopping): draw the Shopping page's charts in the theme's ink, as Mentions' trend does - #1585
Merged
Merged
Conversation
… Mentions' trend does The Card rate bars and the cards trend were blue (--chart-2, --chart-4). They now follow Mentions & sentiment over time: the theme's primary (black on light, near-white on dark), and the trend's own series as an area with the same fading fill. All cards, the second series, is a grey dashed line, told apart by lightness and line rather than hue. No dots on the lines, an active dot on hover, as in Mentions. The Where AI sends shoppers split keeps its own colours: one per destination, checked for contrast and colour-blind separation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
approved these changes
Oct 27, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
What I checked:
- Contrast, light and dark.
--primaryis oklch(0.205) on light and oklch(0.87) on dark (globals.css:59,:96).--muted-foregroundis 0.556 and 0.708 (:64,:101). The charts sit onvar(--card).- The bars and "Your cards" stand at 17.9:1 against the card on light and 12.1:1 on dark. "All cards" stands at 4.7:1 on light and 6.9:1 on dark.
- That's above 3:1 for the marks, and above 4.5:1 for the tooltip and legend text drawn in those colours.
- Tooltip and legend. Recharts colours each row with the series' stroke, not the fill (
getLegendItemColor(stroke, fill)). So "Your cards" reads in ink, not in the gradient'surl(#…), and "All cards" reads in grey, on the card's background. - The area and the dashed line.
- Own cards never exceed all cards, so the dashed line runs above the area, and it's drawn after it.
- The gradient id is unique on the page. The page draws one trend (
page.tsx:1138), and Mentions usesmentionsTrendFill. - The trend is zero-filled to 30 days (
shopping.ts:178-188), so dropping the dots never leaves a lone point invisible. - It matches Mentions' trend (
_trend-chart.tsx:80-83and itsArea): the same stroke, the same 0.18→0 fill, no dots, and an active dot of r 4.
- Tests. No test reads these charts' colours or chart types, and nothing tests
shopping_charts.tsx. The Where AI sends shoppers colours are unchanged. - Merge. One commit on 55b49e7 (main), so it merges as is.
- Before the API deploy. Web only. Nothing depends on the API.
Follow-up:
- The legend doesn't show the dash (
shopping_charts.tsx:109,:120).- Recharts' default
legendType="line"draws the same solid icon for both series and ignoresstrokeDasharray. - On dark, ink (0.87) and grey (0.708) are only 1.75:1 apart, so the two icons are hard to tell apart.
- Fix: add
legendType="plainline"to theLine. Recharts then draws its icon with the series'strokeDasharray. Add it to theAreatoo, so both icons have the same shape.
- Recharts' default
7 of 12 tasks
gkhngyk
pushed a commit
that referenced
this pull request
Oct 27, 2026
…gend (#1597) Recharts' default legend icon is a solid line, so "Your cards" and the dashed "All cards" looked alike. On dark they're only 1.75:1 apart. Both series now use legendType="plainline", which draws each icon with its series' own dash. A follow-up from #1585. Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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 free
to 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
The Shopping page (Product Visibility) draws its two charts in the theme's ink, as the Mentions trend does. The user asked for it. Before, they used
--chart-2.One file:
web/src/app/[locale]/(dashboard)/dashboard/shopping/shopping_charts.tsx.var(--primary).ComposedChartin place of theLineChart.--primarystroke, a fill fading from 0.18 to 0 (shoppingTrendFill), no dots, and an active dot (r 4) on hover.4 3) in--muted-foreground.Left as they are on purpose: the merchant colours in Where AI sends shoppers (eBay's blue among them). That's a palette chosen per destination for contrast and colour blindness, not the theme's series colour.
Written by a side session working on the user's behalf, and handed over for the browser check, the full checks and this PR.
Related issue
None. User request.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Open Product Visibility for a brand with shopping cards:
Checked in the browser at 1024 px, light and dark, with this branch's web and the dev DB. Main's 00267 was applied there first: dev lacked it, so the page couldn't read its overview.
Seen in passing, and unchanged here: the card-rate chart labels every other platform under its bars.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run in
web/:yarn format,yarn lint(0 errors),yarn typecheck,yarn testandyarn build.yarn test: 4,125 of 4,126 passed. The one that failed,new-content-dialog.test.tsx, is untouched here and timed out under load. Run alone, its 42 tests pass.🤖 Generated with Claude Code