Skip to content

Add filtering by stars and last-activity (UI + sorting)#2746

Open
DhruvGupta6177 wants to merge 1 commit into
DeepSourceCorp:masterfrom
DhruvGupta6177:feat/filter-stars-activity
Open

Add filtering by stars and last-activity (UI + sorting)#2746
DhruvGupta6177 wants to merge 1 commit into
DeepSourceCorp:masterfrom
DhruvGupta6177:feat/filter-stars-activity

Conversation

@DhruvGupta6177

Copy link
Copy Markdown

This PR adds UI controls and logic allowing users to filter repositories by minimum stars and recent activity (months) on both the index and language pages.

Summary of changes:

  • Added Min Stars and Active Within sliders to pages/index.vue and pages/language/[slug].vue.
  • Implemented reactive filtering (filteredRepositories) and sorting by stars and/or last activity.
  • Added formatStars() helper and a Reset button.
  • Fixed a small typo in pages/index.vue.

How to test:

  1. Run npm install and npm run dev.
  2. Open / and /language/<slug>.
  3. Adjust sliders to verify filtering and sorting work in real time.

This PR targets master.

This PR adds UI controls and logic allowing users to filter repositories by minimum stars and recent activity (months) on both the index and language pages.

Summary of changes:
- Added Min Stars and Active Within sliders to `pages/index.vue` and `pages/language/[slug].vue`.
- Implemented reactive filtering (`filteredRepositories`) and sorting by stars and/or last activity.
- Added `formatStars()` helper and a Reset button.
- Fixed a small typo in `pages/index.vue`.

How to test:
1. Run `npm install` and `npm run dev`.
2. Open `/` and `/language/<slug>`.
3. Adjust sliders to verify filtering and sorting work in real time.

This PR targets `master`.
Copilot AI review requested due to automatic review settings June 2, 2026 13:57
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

@DhruvGupta6177 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

Note

Copilot was unable to run its full agentic suite in this review.

Adds client-side filtering + sorting controls to repository listing pages so users can narrow results by minimum star count and recent activity.

Changes:

  • Add “Min stars” and “Active within” range filters + reset button to the index page and per-language page.
  • Compute filteredRepositories based on selected thresholds and apply sorting for stars / recency.
  • Add helper formatting for star counts (e.g., K suffix).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
pages/language/[slug].vue Adds UI controls and computed filtering/sorting for language-scoped repos.
pages/index.vue Adds the same UI controls and computed filtering/sorting for the full repo list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pages/index.vue
Comment on lines +56 to +65
let repos = allRepos.filter(r => {
if (minStars.value && Number(r.stars) < Number(minStars.value)) return false
if (activeWithinMonths.value) {
const months = Number(activeWithinMonths.value)
const last = dayjs(r.last_modified)
if (!last.isValid()) return false
if (now.diff(last, 'month') > months) return false
}
return true
})
Comment thread pages/language/[slug].vue
Comment on lines +70 to +82
const filteredRepositories = computed(() => {
const now = dayjs()

let repos = allRepos.filter(r => {
if (minStars.value && Number(r.stars) < Number(minStars.value)) return false
if (activeWithinMonths.value) {
const months = Number(activeWithinMonths.value)
const last = dayjs(r.last_modified)
if (!last.isValid()) return false
if (now.diff(last, 'month') > months) return false
}
return true
})
Comment thread pages/language/[slug].vue
Comment on lines +84 to +90
// Sorting: prioritize active filter (recent), then stars. If both present, sort by stars desc then last_modified desc
if (minStars.value && activeWithinMonths.value) {
repos.sort((a, b) => {
if (b.stars !== a.stars) return b.stars - a.stars
return new Date(b.last_modified) - new Date(a.last_modified)
})
} else if (minStars.value) {
Comment thread pages/index.vue
Comment on lines +5 to +6
<label class="text-sm text-vanilla-400">Min stars:</label>
<input type="range" min="0" max="50000" step="10" v-model.number="minStars" class="w-64" />
Comment thread pages/index.vue
Comment on lines +11 to +12
<label class="text-sm text-vanilla-400">Active within:</label>
<input type="range" min="0" max="24" step="1" v-model.number="activeWithinMonths" class="w-64" />
Comment thread pages/index.vue
Comment on lines +45 to +56
const minStars = ref(0)
const activeWithinMonths = ref(0)

function resetFilters() {
minStars.value = 0
activeWithinMonths.value = 0
}

const filteredRepositories = computed(() => {
const now = dayjs()

let repos = allRepos.filter(r => {
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