feat: add star count and last activity filtering for repositories #2615#2767
Open
fragan7dsouza wants to merge 1 commit into
Open
feat: add star count and last activity filtering for repositories #2615#2767fragan7dsouza wants to merge 1 commit into
fragan7dsouza wants to merge 1 commit into
Conversation
|
@fragan7dsouza is attempting to deploy a commit to the DeepSource Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Adds UI/state for filtering repository listings by minimum GitHub stars and by “last activity” recency, and applies those filters (with conditional sorting) on both the home page and language-specific listing pages.
Changes:
- Added a new
Filterscomponent with “Min Stars” and “Last Activity” dropdowns. - Introduced global filter state via new Nuxt
useStatecomposables. - Updated index and language pages to render filtered/sorted repository lists and an empty-state message.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
pages/language/[slug].vue |
Applies star/activity filtering + conditional sorting to language-specific repository lists and adds empty-state UI. |
pages/index.vue |
Applies star/activity filtering + conditional sorting to the full repository list and adds empty-state UI. |
composables/states.js |
Adds global Nuxt state for the new filter controls. |
components/Filters.vue |
New filter UI component that binds to the global filter state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+27
to
+28
| <option :value="90">Within 3 months</option> | ||
| <option :value="180">Within 6 months</option> |
Comment on lines
+18
to
+42
| const filteredRepositories = computed(() => { | ||
| let repos = [...Repositories] | ||
|
|
||
| // Filter by min stars | ||
| if (minStars.value > 0) { | ||
| repos = repos.filter(repo => repo.stars >= minStars.value) | ||
| } | ||
|
|
||
| // Filter by activity | ||
| if (activityDays.value !== 'all') { | ||
| const limitDate = dayjs().subtract(Number(activityDays.value), 'day') | ||
| repos = repos.filter(repo => dayjs(repo.last_modified).isAfter(limitDate)) | ||
| } | ||
|
|
||
| // Sort | ||
| if (minStars.value > 0 && activityDays.value !== 'all') { | ||
| repos.sort((a, b) => b.stars - a.stars || dayjs(b.last_modified).diff(dayjs(a.last_modified))) | ||
| } else if (minStars.value > 0) { | ||
| repos.sort((a, b) => b.stars - a.stars) | ||
| } else if (activityDays.value !== 'all') { | ||
| repos.sort((a, b) => dayjs(b.last_modified).diff(dayjs(a.last_modified))) | ||
| } | ||
|
|
||
| return repos | ||
| }) |
Comment on lines
+22
to
+46
| const filteredRepositories = computed(() => { | ||
| let repos = [...repositories] | ||
|
|
||
| // Filter by min stars | ||
| if (minStars.value > 0) { | ||
| repos = repos.filter(repo => repo.stars >= minStars.value) | ||
| } | ||
|
|
||
| // Filter by activity | ||
| if (activityDays.value !== 'all') { | ||
| const limitDate = dayjs().subtract(Number(activityDays.value), 'day') | ||
| repos = repos.filter(repo => dayjs(repo.last_modified).isAfter(limitDate)) | ||
| } | ||
|
|
||
| // Sort | ||
| if (minStars.value > 0 && activityDays.value !== 'all') { | ||
| repos.sort((a, b) => b.stars - a.stars || dayjs(b.last_modified).diff(dayjs(a.last_modified))) | ||
| } else if (minStars.value > 0) { | ||
| repos.sort((a, b) => b.stars - a.stars) | ||
| } else if (activityDays.value !== 'all') { | ||
| repos.sort((a, b) => dayjs(b.last_modified).diff(dayjs(a.last_modified))) | ||
| } | ||
|
|
||
| return repos | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…615)