Skip to content

feat: add star count and last activity filtering for repositories #2615#2767

Open
fragan7dsouza wants to merge 1 commit into
DeepSourceCorp:masterfrom
fragan7dsouza:filter-by-stars-activity
Open

feat: add star count and last activity filtering for repositories #2615#2767
fragan7dsouza wants to merge 1 commit into
DeepSourceCorp:masterfrom
fragan7dsouza:filter-by-stars-activity

Conversation

@fragan7dsouza

Copy link
Copy Markdown

…615)

Copilot AI review requested due to automatic review settings June 23, 2026 11:57
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@fragan7dsouza is attempting to deploy a commit to the DeepSource Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 Filters component with “Min Stars” and “Last Activity” dropdowns.
  • Introduced global filter state via new Nuxt useState composables.
  • 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 thread components/Filters.vue
Comment on lines +27 to +28
<option :value="90">Within 3 months</option>
<option :value="180">Within 6 months</option>
Comment thread pages/index.vue
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 thread pages/language/[slug].vue
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
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants