fix(sidebar): order by created at#1251
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR refactors workflow ordering across the entire application from alphabetical sorting by name to chronological sorting by creation date (newest first). The changes introduce a new createdAt field to the WorkflowMetadata interface and implement consistent sorting behavior across multiple components.
The implementation adds the createdAt timestamp to workflow metadata throughout the system, ensuring all workflows track both creation time and last modification time separately. In the workflow registry store, the code properly handles the createdAt field during workflow creation, marketplace imports, duplications, and database fetching. Importantly, the update logic preserves the original createdAt value to maintain data integrity.
The sorting changes are applied consistently across four key components: the sidebar, control bar, and user input copilot component. Each component now uses the same sorting logic that compares createdAt timestamps in descending order. This creates a unified user experience where workflows appear in the same chronological order throughout the application interface.
The change fits naturally into the existing codebase architecture, leveraging the established WorkflowMetadata type system and following the same patterns used for the existing lastModified field. The implementation maintains backward compatibility and includes proper null checking for the new timestamp field.
Confidence score: 4/5
- This PR is safe to merge with low risk as it primarily affects UI ordering without changing core functionality
- Score reflects well-structured changes with proper type safety, but complexity from touching multiple components and data model changes
- Pay close attention to the store.ts file for proper timestamp handling during workflow operations
5 files reviewed, no comments
Summary
Order workflows by created at.
Type of Change
Testing
Manually.
Checklist