fix(sidebar): re-ordering based on last edit is confusing#1248
fix(sidebar): re-ordering based on last edit is confusing#1248icecrasher321 merged 1 commit intostagingfrom
Conversation
There was a problem hiding this comment.
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:
- Sidebar component: The
useMemohook that categorizes workflows now sorts both regular and temporary workflows alphabetically usinglocaleCompare()instead of the previous date-based sorting - Control bar component: The
getSidebarOrderedWorkflowsfunction switches to alphabetical sorting, affecting workflow navigation after deletion - Copilot user input: The
ensureWorkflowsLoadedfunction aligns its sorting with the sidebar approach for consistency in the@mentionworkflow 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
| : new Date(b.lastModified).getTime() | ||
| return dateB - dateA | ||
| }) | ||
| .sort((a, b) => a.name.localeCompare(b.name)) |
There was a problem hiding this comment.
style: Consider using localeCompare with locale options for consistent international sorting behavior
Summary
Keeps reordering the sidebar. Keep it stable with alphabetical sort.
Type of Change
Testing
Manually
Checklist