Skip to content

fix(frontend): address review suggestions from embed card PRs - #390

Merged
junhoyeo merged 1 commit into
mainfrom
fix/embed-card-review-suggestions
Apr 2, 2026
Merged

fix(frontend): address review suggestions from embed card PRs#390
junhoyeo merged 1 commit into
mainfrom
fix/embed-card-review-suggestions

Conversation

@junhoyeo

@junhoyeo junhoyeo commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #384 and #386 — addresses all code review suggestions from Copilot and cubic.

Fixes

From #384 (embed card redesign):

  • Rank accent bar uses amber for non-medal ranksrankAccent was computed identically to rankColor via getRankColor(), so non-medal ranks rendered blue (rankDefault) for the accent bar instead of amber. Now uses palette.accentRank (#D29922 dark / #9A6700 light) for the default accent, while medal ranks (1–3) keep their specific colors. (Identified by cubic)

From #386 (contribution graph):

  • Skip contribution fetch in compact mode?compact=1&graph=1 no longer triggers an unnecessary backend call since the renderer ignores contributions in compact mode anyway. (Identified by cubic)
  • Graceful degradation on graph fetch errors — Contribution fetch failures now fall back to null via .catch(() => null) instead of triggering a 500 response, so the stats-only card still renders. (Identified by cubic)
  • Cutoff date alignment buffer — Added 7-day buffer before the 1-year cutoff using UTC-based dates, so contribution data for the first visible week of the grid isn't missing. (Identified by Copilot)
  • SQL-level aggregation — Replaced JS-side Map aggregation with SUM(cost) GROUP BY date in the query, reducing data transfer for users with many submissions. (Identified by Copilot)

Tests

  • Added test: uses amber accent bar for non-medal ranks instead of brand blue
  • All 23 tests pass

Open with Devin

Summary by cubic

Addresses review feedback from #384 (embed card redesign) and #386 (contribution graph) to polish the profile embed. Fixes rank accents, avoids unnecessary graph fetches in compact mode, adds graceful fallbacks, aligns UTC cutoff dates with a 7‑day buffer, and moves contribution aggregation to SQL.

  • Bug Fixes

    • Use amber accent bar for non‑medal ranks; medal ranks keep their colors.
    • Skip contribution fetch when compact=1 and graph=1.
    • On graph fetch failure, return null so the stats‑only card still renders.
    • Use UTC cutoff of one year ago minus 7 days to include the first visible week.
  • Refactors

    • Aggregate contributions with SUM(cost) GROUP BY date in SQL to reduce data transfer.

Written for commit 2fc5c83. Summary will update on new commits.

@vercel

vercel Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokscale Ready Ready Preview, Comment Apr 2, 2026 2:47am

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@junhoyeo
junhoyeo merged commit 9fc8f5c into main Apr 2, 2026
6 checks passed
@junhoyeo
junhoyeo deleted the fix/embed-card-review-suggestions branch April 2, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant