Skip to content

Conversation

@Adityakumar37
Copy link
Contributor

@Adityakumar37 Adityakumar37 commented Dec 15, 2025

What kind of change does this PR introduce?

  • Performance optimization (non-functional change)
  • Minor refactor to move expensive calculations out of render

**Issue Number:#1965
Closes #1965


Screenshots/videos:

Before:

  • Hover animations on blog cards were delayed on page 2+ of the Blog listing

After:

Screen.Recording.2025-12-16.at.12.02.28.AM.mov

(No visual UI changes)


If relevant, did you update the documentation?

  • Not required (no user-facing changes)

Summary

Hover animations on the Blog page felt delayed on paginated views (page 2 and beyond).
This was caused by runtime-heavy operations being executed during render, including
reading-time calculations for each blog post.

This PR improves performance by:

  • Moving reading-time calculation to build time (getStaticProps)
    Reading time was previously computed during render for each blog card.
    This calculation is now performed once at build time and passed as static
    data, eliminating repeated runtime work on the client.

  • Reducing main-thread work on paginated pages
    On page 2 and beyond, multiple blog cards were rendered simultaneously,
    causing expensive computations during render and resulting in delayed
    hover interactions. By precomputing data, render work is minimized and
    hover responsiveness is improved.

  • Preserving existing hover styles and UI behavior
    No CSS, animation, or interaction logic was modified. Hover behavior
    remains exactly the same; only the underlying performance has been
    optimized.

As a result, reading time is now computed at build time to avoid repeated runtime
calculations during pagination, improving hover responsiveness without
changing UI behavior.


Does this PR introduce a breaking change?

  • No. This change is internal and does not affect public APIs or UI behavior.

Checklist

  • Read, understood, and followed the contributing guidelines

@github-actions
Copy link

Hi @Adityakumar37! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview 4ede8e6

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d94a3bc) to head (4ede8e6).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2005   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           30        30           
  Lines          633       633           
  Branches       196       196           
=========================================
  Hits           633       633           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

Hi @Adityakumar37! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready to review

Development

Successfully merging this pull request may close these issues.

🐛 Bug: Hover effect delay on cards in 3rd and 4th row of blog grid

1 participant