Scale the analytics projected-total dot with the bar band on mobile#6099
Merged
Conversation
The projected end-of-day circle rendered at a fixed 4px radius, which reads fine on desktop but dominates the chart on narrow viewports where the totals-line dots shrink with the band (~band/7, see lineProps in Chart.tsx). Size the projection marker with the same proportion, capped at the previous 4px, so it stays quieter than the booked-total dot at every width. Fixes #6089 Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Self-review (fable-style):
Verdict: PASS, no P1/P2. |
Contributor
Greptile SummaryThis PR scales the projected sales marker with the chart band on narrow screens. The main changes are:
Confidence Score: 5/5This looks safe to merge. No blocking issues found in the changed code.
What T-Rex did
Important Files Changed
Reviews (3): Last reviewed commit: "Add hosted-preview screenshots for the p..." | Re-trigger Greptile |
gumclaw
marked this pull request as ready for review
July 21, 2026 22:52
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.
What
Makes the analytics projected end-of-day circle (
ProjectedDotinapp/javascript/components/Analytics/SalesChart.tsx) scale with the bar band width instead of rendering at a fixed 4px radius:r={Math.min(width / 7, 4)}. On desktop nothing changes (bands are wide, the 4px cap applies). On narrow viewports — where the solid totals-line dots already shrink proportionally (~band/7inlineProps,Chart.tsx) — the projection marker now shrinks with them instead of dwarfing the actual-sales dot.Adds two test assertions: the radius formula on the desktop-width render, and a mobile-shaped render (375px container, 31 daily points) verifying the radius comes out below the 4px cap.
Why
Fixes #6089 — Jordi Bruin's follow-up to the projected-total circle shipped in #6076: "on mobile the dot is too big and stands out." The dot should stay subtle/faint at small widths, matching the desktop weight relative to the rest of the chart. This mirrors how the existing line dots handle mobile (#6048 lineage). The anchoring guarantee from #6048/#6053 (dot centered on today's band at any width) is untouched — the
cxcomputation is unchanged and remains covered by the existing centering test.Before / After
Screenshots (hosted preview app)
Captured on the hosted preview (
https://fix-projected-dot-mobile-size.apps.staging.gumroad.org, seeded same-day + prior-day sales forseller@gumroad.com, Playwright @2x). In-page assertions ran before each capture: exactly onechart-projected-dot; dot center-x within 0.35px of the last totals-line dot on both widths; dot strictly above the line dot. Measured radii: desktopr=4(cap applies, unchanged), mobile 375pxr≈2.14— smaller than the totals-line dot (r≈2.8) at that width.Mobile 375px — the projected circle now renders small and faint, quieter than the solid line dots:
Desktop 1280px — no regression, the 4px cap applies and the circle looks identical to production:
QA steps
seller@gumroad.com/password, 2FA000000)./dashboard/sales) with a date range ending on the seller-local today, with ≥1 sale today (seeded on the preview).Test Results
(vitest run, local, at HEAD of this branch)
AI disclosure
Written by Claude Fable 5 (Hermes agent "gumclaw") running the autonomous dev dispatcher. Instructions: implement the viewport-aware sizing requested in #6089 (keep the #6048 anchoring fix intact), add tests, verify with vitest, and open a PR per CONTRIBUTING.md. Hosted-preview screenshots captured and verified by the same agent.