Skip to content

Sort blogs index in descending order (newest first)#1657

Merged
sanjay-kv merged 4 commits into
mainfrom
copilot/arrange-blog-posts-descending
May 23, 2026
Merged

Sort blogs index in descending order (newest first)#1657
sanjay-kv merged 4 commits into
mainfrom
copilot/arrange-blog-posts-descending

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

Description

The blogs listing currently follows source order, causing older posts to appear before newly added ones. This change enforces descending ordering so newer posts consistently render first on /blogs.

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

  • Ordering logic
    • Updated /src/pages/blogs/index.tsx to sort blog entries by id descending before search filtering and pagination.
  • Behavioral impact
    • The blogs grid now shows latest posts first by default, while preserving existing search and pagination behavior.
  • Implementation snippet
    const filteredBlogs = React.useMemo(() => {
      const sortedBlogs = [...blogs].sort((a, b) => b.id - a.id);
      return filterBlogsBySearchTerm(sortedBlogs, searchTerm);
    }, [searchTerm, blogs]);

Dependencies

  • No new dependencies.
  • No version or configuration changes.

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
recode-website Ready Ready Preview, Comment May 23, 2026 3:05am

Copilot AI changed the title [WIP] Arrange blog posts in descending order Sort blogs index in descending order (newest first) May 23, 2026
Copilot AI requested a review from sanjay-kv May 23, 2026 03:05
@sanjay-kv sanjay-kv marked this pull request as ready for review May 23, 2026 03:06
@sanjay-kv sanjay-kv merged commit 73512c6 into main May 23, 2026
7 checks passed
@sanjay-kv sanjay-kv deleted the copilot/arrange-blog-posts-descending branch May 23, 2026 03:13
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.

Arrange the blog posts in descending order

2 participants