-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement sort most popular sessions view #12
Conversation
update calendar view for schedule page
Reviewer's Guide by SourceryThis pull request implements sorting functionality in the calendar session view. It adds a sort dropdown menu and implements logic for sorting sessions by title, time, or popularity. The changes primarily affect the App.vue, LinearSchedule.vue, and Session.vue components, with additional new components created for the dropdown functionality. File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @odkhang - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
src/components/LinearSchedule.vue
Outdated
return Object.entries(buckets).map(([date, sessions]) => { | ||
let sessionBucket = {} | ||
return Object.entries(buckets).map(([date, sessions]) => ({ | ||
date: sessions[0].start, | ||
// sort by room for stable sort across time buckets | ||
sessions: sessions.sort((a, b) => this.rooms.findIndex(room => room.id === a.room.id) - this.rooms.findIndex(room => room.id === b.room.id)) | ||
})) | ||
} else { | ||
let sortedSessions = this.sessions.slice().sort((a, b) => { | ||
switch (this.sortBy) { | ||
case 'title': | ||
sessionBucket = { | ||
date: sessions[0].start, | ||
// sort by room for stable sort across time buckets | ||
sessions: sessions.sort((a, b) => { | ||
return a.title.localeCompare(b.title) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (performance): Optimize sorting logic for better performance
The new sorting implementation in sessionBuckets computed property is more flexible but potentially less efficient for the 'time' sort case. Consider optimizing this logic, perhaps by maintaining separate sorted lists for each sort type and updating them incrementally as sessions change.
src/components/LinearSchedule.vue
Outdated
return Object.entries(buckets).map(([date, sessions]) => ({ | ||
date: sessions[0].start, | ||
// sort by room for stable sort across time buckets | ||
sessions: sessions.sort((a, b) => this.rooms.findIndex(room => room.id === a.room.id) - this.rooms.findIndex(room => room.id === b.room.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project already include lodash, please use "sort-by-key" strategy (https://lodash.com/docs/4.17.15#sortBy), it produces simpler code.
Hi @hongquan, fixed as your suggestion, please help me to review it again |
This PR closes/references issue fossasia/eventyay-talk#161 . It does so by:
Add sort dropdown in session view
implement logic when sort with title/time/popularity
Summary by Sourcery
Implement a sorting feature in the calendar session view, allowing users to sort sessions by title, time, or popularity. Introduce dropdown components for filtering sessions by tracks, rooms, and session types, and enhance the UI for better responsiveness and usability.
New Features:
Enhancements: