🎨 Improved y-axis scaling and country names in Analytics#28708
🎨 Improved y-axis scaling and country names in Analytics#28708peterzimon wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
WalkthroughTwo parallel display fixes across the stats and posts apps, plus a newsletter chart refinement. The 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx build @tryghost/activitypub |
✅ Succeeded | 1s | View ↗ |
nx build @tryghost/announcement-bar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/admin-toolbar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/comments-ui |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/signup-form |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/sodo-search |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/portal |
✅ Succeeded | <1s | View ↗ |
nx run-many -t test:unit -p @tryghost/posts,@tr... |
✅ Succeeded | 2m 54s | View ↗ |
Additional runs (5) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-06-22 15:54:12 UTC
24c00a6 to
5bcbe42
Compare
ref https://linear.app/tryghost/issue/NY-1365/ - the Avg. click rate chart used a fixed-step rounding that snapped the upper bound up to 10%, making sub-1% rates render as invisible bars - bracket the y-axis to the data: <1% → 0–1%, 1–10% → 0 to the next whole percent, 10%+ → 0 to the next multiple of 10 - include the avg reference line in the bracket pick so it's always inside the visible range
ref https://linear.app/tryghost/issue/NY-1365/ - the Locations card and country filter showed the official ISO names from i18n-iso-countries ("Russian Federation", "Taiwan, Province of China", "Korea, Republic of", etc.), which read awkwardly - switched the library lookup to {select: 'alias'} so the short/common form is returned when one exists (Russia, China, Taiwan, Iran, Vietnam, Czechia, United States, …) - added explicit overrides for entries where i18n-iso-countries has no alias or its alias picks the wrong form: GB → United Kingdom, KR → South Korea, LA → Laos, MD → Moldova, SY → Syria - dropped the now-redundant US/TW/TWN entries from STATS_LABEL_MAPPINGS
5bcbe42 to
5be0c82
Compare
ref https://linear.app/tryghost/issue/NY-1365/ - mirrored the cleanup from the Web analytics PR (#28708) in the Post analytics web tab: the Locations card and the country filter showed the official ISO names from i18n-iso-countries ("Russian Federation", "Taiwan, Province of China", …) - switched the library lookup to {select: 'alias'} so the short/common form is returned when one exists - added the same explicit overrides for entries where i18n-iso-countries has no alias or picks the wrong form: GB → United Kingdom, KR → South Korea, LA → Laos, MD → Moldova, SY → Syria - dropped the now-redundant US/TW/TWN/CN entries from the posts app's STATS_LABEL_MAPPINGS

Newsletter chart y-axis scaling
The Avg. click rate chart on Analytics → Newsletters used a fixed-step rounding (nearest 0.1) for its y-axis, which snapped the upper bound to 10% even when the click rate was a fraction of a percent — making sub-1% bars effectively invisible.
This change brackets the y-axis to the actual data:
< 1%→0% – 1%1% – 10%→0%to the next whole percent above the max10% – 100%→0%to the next multiple of 10 above the maxThe avg reference line value is included in the bracket pick, so the dashed avg line is always inside the visible range (previously it could fall outside and be hidden).
Examples:
Country names in Web analytics
The Locations card used to render the official ISO country names from
i18n-iso-countries("Russian Federation", "Taiwan, Province of China", "Korea, Republic of"…), which read awkwardly. We now ask the library for the short/common form viagetName(code, 'en', {select: 'alias'})and add a few manual overrides for countries where the library has no alias. Net result:ref https://linear.app/tryghost/issue/NY-1365/
Test plan