From a688fd5f2167f060bb3d3890fbcac0cc7197b586 Mon Sep 17 00:00:00 2001 From: Zaiba Machhaliya Date: Thu, 13 Aug 2026 14:29:42 +0530 Subject: [PATCH 1/3] feat: add repository health filters --- src/pages/RepositoriesPage.jsx | 74 +++++++++++++++++++++++++++++++++- src/styles/global.css | 1 + 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/src/pages/RepositoriesPage.jsx b/src/pages/RepositoriesPage.jsx index f5884f4..e490b12 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 + if (loading) return if (!model) return null const TABLE_COLS = [ @@ -188,6 +208,56 @@ export default function RepositoriesPage() { ))} +
+ {HEALTH_FILTERS.map(l => ( + + ))} +
+
+ +
{allRepos?.length ? ( <> diff --git a/src/styles/global.css b/src/styles/global.css index 1f7abb3..d7a2cb2 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -76,6 +76,7 @@ input[type="date"]::-webkit-calendar-picker-indicator { /* Light theme */ [data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; +} .navbar-link:hover { color: var(--accent) !important; } \ No newline at end of file From 284da84dd2c18bdec760fea1ac795b323f4aa828 Mon Sep 17 00:00:00 2001 From: Zaiba Machhaliya Date: Thu, 13 Aug 2026 17:38:04 +0530 Subject: [PATCH 2/3] fix: improve repository filter states --- src/pages/RepositoriesPage.jsx | 174 +++++++++++++++++++++++---------- 1 file changed, 125 insertions(+), 49 deletions(-) diff --git a/src/pages/RepositoriesPage.jsx b/src/pages/RepositoriesPage.jsx index e490b12..b9e6f0e 100644 --- a/src/pages/RepositoriesPage.jsx +++ b/src/pages/RepositoriesPage.jsx @@ -196,6 +196,7 @@ export default function RepositoriesPage() {
{ACTIVITY_CLASSIFICATIONS.map(l => (
+ {allRepos?.length ? ( - <> - {/* Table view */} -
- - - - {TABLE_COLS.map(([k, l]) => ( - - ))} - - - - {visible.map((r, i) => ( - - + + + + + + ))} + +
- 0 ? ( + <> + {/* Table view */} +
+ + + + {TABLE_COLS.map(([k, l]) => ( + + ))} + + + + + {visible.map((r, i) => ( + + + + + + + + - - - - - - - ))} - -
+ +
+ {r.name} +
+ + {r.orgLogin && ( +
+ {r.orgLogin} +
+ )} +
+
+ {r.stargazers_count.toLocaleString()} + + {r.forks_count.toLocaleString()} + 30 + ? 'var(--red)' + : 'var(--text2)' }} > -
{r.name}
- {r.orgLogin &&
{r.orgLogin}
} - -
{r.stargazers_count.toLocaleString()}{r.forks_count.toLocaleString()} 30 ? 'var(--red)' : 'var(--text2)' }}>{r.open_issues_count} -
- - Last push: {r.pushed_at?.slice(0, 10)} - -
-
- setShown(s => s + 20)} /> -
- ) - : ( + {r.open_issues_count} +
+ + +
+ + + + Last push: {r.pushed_at?.slice(0, 10)} + +
+
+ + setShown(s => s + 20)} + /> +
+ + ) : (
} - title="No repositories available" - description="We couldn't find any repositories for this organization yet." - buttonText="Go to Home" - onButtonClick={() => navigate('/')} + title="No repositories match your filters" + description="Try changing your filters or reset them to see all repositories." + buttonText="Reset Filters" + onButtonClick={resetFilters} />
- )} + ) + ) : ( +
+ } + title="No repositories available" + description="We couldn't find any repositories for this organization yet." + buttonText="Go to Home" + onButtonClick={() => navigate('/')} + /> +
+ )} ) } From 3c5a6d13a33f6edc1507154730facf092f10cee8 Mon Sep 17 00:00:00 2001 From: Zaiba Machhaliya Date: Thu, 13 Aug 2026 17:49:02 +0530 Subject: [PATCH 3/3] fix: improve activity filter accessibility --- src/pages/RepositoriesPage.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/RepositoriesPage.jsx b/src/pages/RepositoriesPage.jsx index b9e6f0e..fdbbfd9 100644 --- a/src/pages/RepositoriesPage.jsx +++ b/src/pages/RepositoriesPage.jsx @@ -197,6 +197,7 @@ export default function RepositoriesPage() { {ACTIVITY_CLASSIFICATIONS.map(l => (