Skip to content

Commit ecf5ef9

Browse files
authored
Merge pull request #175 from RivianTrackr/claude/add-stats-share-image-qmNqS
Fix category pills overlapping top-rated callout in share image
2 parents 49f3748 + bc0f956 commit ecf5ef9

5 files changed

Lines changed: 21 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to the Rivian Tire Guide plugin will be documented in this f
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [1.21.1] - 2026-03-01
8+
9+
### Fixed
10+
- **Share image: category pills overlapping top-rated callout** — The category pills and top-rated tire banner occupied the same vertical space when 5 brands were present. The callout Y-position is now computed dynamically from the bottom of both the stat cards and the categories section, and brand bar spacing was tightened to give categories more room.
11+
712
## [1.21.0] - 2026-03-01
813

914
### Added

admin/js/admin-scripts.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
brands.forEach(function(b) { if (b.count > maxBrandCount) maxBrandCount = b.count; });
301301

302302
brands.forEach(function(brand, i) {
303-
var barY = rightY + 35 + i * 38;
303+
var barY = rightY + 35 + i * 32;
304304
var barMaxW = 380;
305305
var barW = Math.max(40, (brand.count / maxBrandCount) * barMaxW);
306306
var barH = 26;
@@ -332,21 +332,23 @@
332332
});
333333

334334
// "Categories" section below brands.
335-
var catY = rightY + 35 + Math.max(brands.length, 1) * 38 + 25;
335+
var catY = rightY + 35 + Math.max(brands.length, 1) * 32 + 20;
336336
ctx.fillStyle = colors.textHeading;
337337
ctx.font = 'bold 18px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
338338
ctx.textBaseline = 'top';
339339
ctx.fillText('Categories', rightX, catY);
340340

341341
var cats = (data.categories || []).slice(0, 4);
342-
var catStartY = catY + 32;
342+
var catStartY = catY + 28;
343+
var catMaxRow = 0;
343344
cats.forEach(function(cat, i) {
344345
var chipX = rightX + i * 130;
345346
// Wrap to second row if needed.
346347
var row = 0;
347348
if (i >= 3) { row = 1; chipX = rightX + (i - 3) * 130; }
349+
if (row > catMaxRow) catMaxRow = row;
348350

349-
var tagY = catStartY + row * 36;
351+
var tagY = catStartY + row * 34;
350352
var tagText = cat.name + ' (' + cat.count + ')';
351353

352354
// Pill background.
@@ -365,8 +367,13 @@
365367
});
366368

367369
// --- Top rated tire callout ---
370+
// Position dynamically below both the left stat cards and right categories.
371+
var leftBottom = gridStartY + 2 * (cardH + cardGap) - cardGap;
372+
var rightBottom = cats.length > 0 ? catStartY + catMaxRow * 34 + 26 : catY + 18;
373+
var contentBottom = Math.max(leftBottom, rightBottom);
374+
368375
if (data.topTire) {
369-
var calloutY = 440;
376+
var calloutY = contentBottom + 15;
370377
roundRect(ctx, 60, calloutY, W - 120, 60, 10);
371378
ctx.fillStyle = colors.bgCard;
372379
ctx.fill();

admin/js/admin-scripts.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)