Skip to content

Fix PR-metrics scoping and align UI consistency in Analytics page#118

Merged
bhavik-mangla merged 4 commits into
AOSSIE-Org:mainfrom
Ri1tik:fix-improve-runAdvanceAnalytics-for-standard-complete-analysis
Jul 10, 2026
Merged

Fix PR-metrics scoping and align UI consistency in Analytics page#118
bhavik-mangla merged 4 commits into
AOSSIE-Org:mainfrom
Ri1tik:fix-improve-runAdvanceAnalytics-for-standard-complete-analysis

Conversation

@Ri1tik

@Ri1tik Ri1tik commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues:

Fixes #(issue number)
Problems:

  • Issue dropdown was hardcoded to .slice(0, 12), capping visibility regardless of actual fetch.
  • PR dropdown used model.totalRepos (unfiltered) regardless of PAT — showing many repos with zero PR data when no PAT was connected.
  • Advanced Analytics had no loading state, and its empty-state copy was stale (typo in button name, and text describing issue bucketing instead of PR metrics).
  • Both loading messages hardcoded "top 15 repositories" — not accurate to actual scoping (top 10/org or all repos/org).
  • Clicking "Collect Advanced Metrics" after issues were already loaded caused the whole page to flicker (unmount/remount), since explore() cleared model/orgs synchronously and the page guards on if (!model) return null.

Screenshots/Recordings:

Before:
Screenshot 2026-07-10 015652
Recording:
https://github.com/user-attachments/assets/18e4cb73-c59d-4c2d-aa81-a812a70834d0

After:
Screenshot 2026-07-10 015714
Recording:
https://github.com/user-attachments/assets/29f44fea-3c9c-4e09-a212-ef2fa09be080

Additional Notes:

Fixes:

  • Both dropdowns now derive from actually-fetched data, not the raw model.
  • PR metrics now follow the same trigger flow as Governance: runAdvanceAnalytics checks isComplete, re-explores if still sample-scoped, else skips straight to fetching. runFullAnalytics runs issues + pulls in parallel off the same resolved model, so both stay scoped to the same repo set.
  • Added matching empty/loading states for Advanced Analytics, fixed stale copy, and made both sections hide their empty-state box while loading.
  • Replaced hardcoded "top 15" with accurate PAT-aware text ("top 10 repositories" / "all repositories").
  • Removed the premature setModel(null) / setOrgs([]) clear in explore() — data now swaps in atomically once ready, so the page no longer unmounts mid-refresh.

Repo Scoping Reference:

Metric No PAT (per org) With PAT (per org)
Repos fetched ≤500 all (public_repos count)
Repos used for contributors/issues/pulls 10 (top by weighted score) all fetched repos
Contributors ≤100/repo × 10 repos = ≤1,000/org ≤1000/repo × all repos
Issues ≤100/repo × 10 repos = ≤1,000/org ≤1000/repo × all repos
Pull Requests ≤100/repo × 10 repos = ≤1,000/org ≤1000/repo × all repos

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Recording.2026-07-10.015637.prev.mp4

@github-actions github-actions Bot added no-issue-linked PR has no linked issue frontend Frontend changes javascript JavaScript/TypeScript changes labels Jul 9, 2026
@github-actions github-actions Bot added size/M 51-200 lines changed external-contributor External contributor labels Jul 9, 2026
@Ri1tik Ri1tik added the gsoc GSoC students label Jul 9, 2026
@bhavik-mangla
bhavik-mangla merged commit 1f631af into AOSSIE-Org:main Jul 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor External contributor frontend Frontend changes gsoc GSoC students javascript JavaScript/TypeScript changes no-issue-linked PR has no linked issue size/M 51-200 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants