Skip to content

fix(sidebar): re-ordering based on last edit is confusing#1248

Merged
icecrasher321 merged 1 commit intostagingfrom
fix/alpha-sorting
Sep 5, 2025
Merged

fix(sidebar): re-ordering based on last edit is confusing#1248
icecrasher321 merged 1 commit intostagingfrom
fix/alpha-sorting

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Keeps reordering the sidebar. Keep it stable with alphabetical sort.

Type of Change

  • Bug fix

Testing

Manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Sep 5, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Ready Ready Preview Comment Sep 5, 2025 1:29am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 5, 2025 1:29am

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR changes the workflow sorting behavior from last-modified-time ordering to alphabetical sorting by name across three components in the application. The change addresses a UX issue where workflows would constantly reorder based on edit timestamps, creating confusion for users trying to navigate consistently.

Modified Components:

  1. Sidebar component: The useMemo hook that categorizes workflows now sorts both regular and temporary workflows alphabetically using localeCompare() instead of the previous date-based sorting
  2. Control bar component: The getSidebarOrderedWorkflows function switches to alphabetical sorting, affecting workflow navigation after deletion
  3. Copilot user input: The ensureWorkflowsLoaded function aligns its sorting with the sidebar approach for consistency in the @mention workflow selection

The implementation uses JavaScript's localeCompare() method for proper locale-aware string comparison, with fallback handling for workflows without names ("Untitled Workflow"). This change maintains the existing workflow categorization logic (regular vs temporary, workspace filtering) while only modifying the final sorting step. The alphabetical ordering provides a stable, predictable interface that aligns with typical file browser behavior and reduces cognitive load for users navigating their workflows.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it only changes sorting logic without affecting core functionality
  • Score reflects simple, well-contained changes that improve UX through consistent alphabetical ordering
  • No files require special attention as the changes are straightforward sorting modifications

3 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

: new Date(b.lastModified).getTime()
return dateB - dateA
})
.sort((a, b) => a.name.localeCompare(b.name))
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider using localeCompare with locale options for consistent international sorting behavior

@icecrasher321 icecrasher321 merged commit e31627c into staging Sep 5, 2025
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/alpha-sorting branch September 5, 2025 05:50
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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