Skip to content

feat: sort by date#17

Merged
nikitalokhmachev-ai merged 2 commits intomainfrom
nikita-sort-by-date-within-buckets
May 8, 2025
Merged

feat: sort by date#17
nikitalokhmachev-ai merged 2 commits intomainfrom
nikita-sort-by-date-within-buckets

Conversation

@nikitalokhmachev-ai
Copy link
Collaborator

@nikitalokhmachev-ai nikitalokhmachev-ai commented May 8, 2025

User description

In this PR, I added sorting archives by date within the date buckets, with the most recent ones appearing at the top.


PR Type

Enhancement


Description

  • Sort archives by date within date buckets

  • Most recent archives appear at top


Changes walkthrough 📝

Relevant files
Enhancement
argo-archive-list.ts
Add chronological sorting within date buckets                       

src/argo-archive-list.ts

  • Added sorting of pages array by timestamp (ts) in descending order
  • Most recent pages now appear at the top within each date bucket
  • Maintained all existing page rendering functionality
  • +39/-37 

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link
    Collaborator Author

    @nikitalokhmachev-ai nikitalokhmachev-ai left a comment

    Choose a reason for hiding this comment

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

    #16

    @pr-agent-monadical
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Sorting Logic

    The implementation sorts archives by timestamp using Number() conversion. Verify that page.ts is always a valid numeric string to avoid unexpected sorting behavior.

    .sort((a, b) => Number(b.ts) - Number(a.ts))

    Comment on lines +166 to +168
    ${pages
    .sort((a, b) => Number(b.ts) - Number(a.ts))
    .map((page) => {

    Choose a reason for hiding this comment

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

    Suggestion: Add a null check before sorting the pages array to prevent potential runtime errors if pages is null or undefined. [possible issue, importance: 7]

    Suggested change
    ${pages
    .sort((a, b) => Number(b.ts) - Number(a.ts))
    .map((page) => {
    ${(pages || [])
    .sort((a, b) => Number(b.ts) - Number(a.ts))
    .map((page) => {

    @Shrinks99 Shrinks99 linked an issue May 8, 2025 that may be closed by this pull request
    @nikitalokhmachev-ai nikitalokhmachev-ai merged commit 2477863 into main May 8, 2025
    1 of 4 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    Sort side-panel archive list by date

    2 participants