diff --git a/src/pages/RepositoriesPage.jsx b/src/pages/RepositoriesPage.jsx
index f5884f4..fdbbfd9 100644
--- a/src/pages/RepositoriesPage.jsx
+++ b/src/pages/RepositoriesPage.jsx
@@ -11,17 +11,23 @@ import AnalysisBanner from '../components/AnalysisBanner'
import { RepositorySkeleton } from '../components/Orgexplorerskeletons';
const ACTIVITY_CLASSIFICATIONS = ['All', 'Thriving', 'Active', 'Dormant', 'Hibernating']
+const HEALTH_FILTERS = ['All', 'Healthy', 'Moderate', 'Poor']
const ACTIVITY_COLORS = { Thriving: 'var(--green)', Active: 'var(--blue)', Dormant: 'var(--amber)', Hibernating: 'var(--red)' }
+const HEALTH_COLORS = { Healthy: 'var(--green)', Moderate: 'var(--amber)', Poor: 'var(--red)' }
+
export default function RepositoriesPage() {
const { model, isComplete, loading, runFullExplore } = useApp()
const [search, setSearch] = useState('')
const [activityClassification, setActivityClassification] = useState('All')
const [lang, setLang] = useState('All Languages')
+ const [health, setHealth] = useState('All')
const [shown, setShown] = useState(20)
const [openInfo, setOpenInfo] = useState(false)
const infoRef = useRef(null)
+
+
useEffect(() => {
function handleClickOutside(event) {
if (
@@ -44,17 +50,31 @@ export default function RepositoriesPage() {
['All Languages', ...new Set(allRepos.map(r => r.language).filter(Boolean))].slice(0, 10),
[allRepos])
+ const resetFilters = () => {
+ setSearch('')
+ setActivityClassification('All')
+ setLang('All Languages')
+ setHealth('All')
+ setShown(20)
+ }
+
const filtered = useMemo(() => allRepos.filter(r =>
(activityClassification === 'All' || r.activityClassification === activityClassification) &&
(lang === 'All Languages' || r.language === lang) &&
+ (health === 'All' ||
+ (health === 'Healthy' && r.healthScore >= 70) ||
+ (health === 'Moderate' && r.healthScore >= 40 && r.healthScore < 70) ||
+ (health === 'Poor' && r.healthScore < 40)
+ ) &&
(!search || r.name.toLowerCase().includes(search.toLowerCase()) ||
(r.description || '').toLowerCase().includes(search.toLowerCase()))
- ), [allRepos, activityClassification, lang, search])
+ ), [allRepos, activityClassification, lang, health, search])
+
const { sorted, sortConfig, onSort } = useSortedData(filtered, 'healthScore', 'desc')
const visible = sorted.slice(0, shown)
- if(loading) return