Skip to content

feat: add Teams Explorer visual mapping and membership editor - #158

Open
AbiramiR-27 wants to merge 5 commits into
AOSSIE-Org:mainfrom
AbiramiR-27:feat/teams-explorer
Open

feat: add Teams Explorer visual mapping and membership editor#158
AbiramiR-27 wants to merge 5 commits into
AOSSIE-Org:mainfrom
AbiramiR-27:feat/teams-explorer

Conversation

@AbiramiR-27

@AbiramiR-27 AbiramiR-27 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues:

Fixes #150

Description of Changes:

Adds a new Teams Explorer dashboard inside OrgExplorer that fetches team data from the GitHub API and renders an interactive relationship graph.

  • Teams Visual Graph mapping: Uses D3 force-directed simulation to render Team nodes (purple hexagons), member contributors (orbiting circular avatar nodes), and managed repositories (colored by health score).
  • Visual Team Manager: Allows developers with write-access tokens to drag contributor avatar nodes and drop them directly onto team parent hexagons, triggering a membership assignment confirmation modal and PUT mutation queries.
  • Lazy Load Lifecycle: Concurrently retrieves organization teams, members, and repos only when the page mounts to keep the homepage/explore load times fast.
  • Detailed Tooltips: Hovering over nodes renders detail stats, descriptions, and links.

Screenshots/Recordings:

N/A

Additional Notes:

  • Includes permissions error handling: explicitly detects 403 Forbidden responses when a user's PAT lacks the read:org scope, displaying helpful guidance instead of standard rate-limit notices.
  • The project compiles successfully under Vite without any compilation errors.

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

Summary by CodeRabbit

  • New Features

    • Added a Teams Explorer page accessible from the main navigation.
    • View organization teams, members, and repositories in an interactive relationship graph.
    • Search and filter teams, inspect repository health, and select teams for analysis.
    • Assign contributors to teams through drag-and-drop or keyboard controls, with confirmation and error handling.
  • Bug Fixes

    • Improved handling of rate-limit and permission errors for clearer feedback.

@github-actions github-actions Bot added enhancement New feature or request frontend Frontend changes javascript JavaScript/TypeScript changes size/XL 500+ lines changed external-contributor External contributor labels Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@AbiramiR-27, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 286589c5-17be-4276-b12f-ba93d65e88af

📥 Commits

Reviewing files that changed from the base of the PR and between 7e87634 and ce9ec76.

📒 Files selected for processing (2)
  • src/pages/TeamsPage.jsx
  • src/services/github.js

Walkthrough

The PR adds a /teams route and Teams Explorer navigation link. It loads GitHub teams, members, and repositories, renders an interactive D3 graph, and supports authenticated contributor-to-team membership updates.

Changes

Teams Explorer

Layer / File(s) Summary
Authenticated team data services
src/services/github.js
GitHub services add PAT-scoped caching, team and member fetchers, repository health enrichment, membership updates, cache invalidation, and distinct rate-limit and forbidden error handling.
Teams route and data loading
src/App.jsx, src/components/Navbar.jsx, src/pages/TeamsPage.jsx
The application adds the /teams route and navigation link. TeamsPage loads organization data with concurrency limits, cancellation protection, partial-error retention, and loading, PAT, and error states.
Team graph and exploration
src/pages/TeamsPage.jsx
TeamsPage filters teams, builds team, contributor, and repository nodes, and renders the D3 force graph with search, selection, tooltips, metrics, and keyboard controls.
Interactive membership assignment
src/pages/TeamsPage.jsx, src/services/github.js
Users can drag or select contributors for team assignment. The page validates duplicates, confirms the action, updates GitHub membership, and updates local state after success.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant TeamsPage
  participant github.js
  participant GitHubAPI
  participant D3Graph

  User->>TeamsPage: Open /teams
  TeamsPage->>github.js: Fetch organization teams
  github.js->>GitHubAPI: GET teams, members, and repositories
  GitHubAPI-->>github.js: Return team data
  github.js-->>TeamsPage: Return enriched teams
  TeamsPage->>D3Graph: Build and render relationship graph
  User->>D3Graph: Drag contributor onto team
  D3Graph->>TeamsPage: Request membership confirmation
  TeamsPage->>github.js: Update team membership
  github.js->>GitHubAPI: PUT team membership
  GitHubAPI-->>github.js: Return update result
  github.js-->>TeamsPage: Return success or error
  TeamsPage->>D3Graph: Update graph state
Loading

Possibly related PRs

Suggested labels: Typescript Lang

Suggested reviewers: ri1tik

Poem

A rabbit maps each team with care,
Links members, repos through the air.
Drag, confirm, then GitHub knows,
Which team each contributor goes.
The graph now hops with lively flair! 🐇

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Teams Explorer graph and membership editor, which are the main changes.
Linked Issues check ✅ Passed The changes implement the Teams Explorer graph, GitHub team data access, and membership updates required by [#150].
Out of Scope Changes check ✅ Passed The changes stay within [#150] by adding Teams Explorer UI, GitHub team services, and navigation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size/XL 500+ lines changed and removed size/XL 500+ lines changed labels Aug 10, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/TeamsPage.jsx`:
- Around line 41-83: Update the useEffect around fetchOrgTeams to prevent stale
requests from updating state after orgName or pat changes. Add an ignore flag or
AbortController with cleanup, and guard every setTeams, setLoading, and setError
call in the fetch, enrichment, empty-result, and error paths so only the active
request updates the view.
- Around line 55-67: Update the enrichment flow around the fetchedTeams
Promise.all so fetchTeamMembers and fetchTeamRepos errors are preserved instead
of converted to empty arrays, and expose an incomplete-data state for affected
teams, including permission, rate-limit, and network failures. Replace the
unbounded per-team parallel loading with a bounded queue/concurrency limit while
retaining successful member and repository results.
- Around line 176-230: Add a keyboard-accessible membership assignment flow
alongside the d3.drag logic in TeamsPage: make contributor/team nodes or an
equivalent native control focusable, allow selecting a contributor and target
team via keyboard, and invoke setAssignModal with the same username, teamName,
teamSlug, and avatar values used by the drag path. Preserve the existing
duplicate-membership check and setAssignError behavior.

In `@src/services/github.js`:
- Around line 162-177: Update updateTeamMembership to invalidate the cached
membership entry after the PUT succeeds, before returning true. Reuse the same
members URL/cache key used by fetchTeamMembers for the specified org and
teamSlug, and leave failed requests uncached.
- Around line 153-160: Update fetchTeamMembers and fetchTeamRepos so
authenticated team resources are not stored or retrieved through the URL-only
fetchWithCache cache; bypass caching for these endpoints or use a cache key
namespaced by a non-secret PAT identity, ensuring entries cannot be shared
across users or with unauthenticated requests.
- Around line 159-160: Update src/services/github.js:159-160 in fetchTeamRepos
to enrich each fetched repository with the analytics model’s repository-data
contract, including a computed healthScore, before returning the records. Update
src/pages/TeamsPage.jsx:145-147 to derive the node’s health rendering only from
the selected repository-data contract fields, removing fallback use of unrelated
fields while preserving the normalized healthScore and color behavior.
- Around line 76-82: Update the 403 handling in the GitHub response
classification flow to detect secondary rate-limit indicators in the response
headers or body even when x-ratelimit-remaining is greater than zero, and
classify those responses as RATE_LIMIT (or the established wait/error result).
Preserve FORBIDDEN only for genuine permission failures.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5bb49382-6bfe-45bc-8b1e-a85c13fd22ab

📥 Commits

Reviewing files that changed from the base of the PR and between 5a02b1a and ea4c4fc.

📒 Files selected for processing (4)
  • src/App.jsx
  • src/components/Navbar.jsx
  • src/pages/TeamsPage.jsx
  • src/services/github.js

Comment thread src/pages/TeamsPage.jsx
Comment thread src/pages/TeamsPage.jsx Outdated
Comment thread src/pages/TeamsPage.jsx
Comment thread src/services/github.js
Comment thread src/services/github.js Outdated
Comment thread src/services/github.js Outdated
Comment thread src/services/github.js
@Ri1tik

Ri1tik commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Please follow the template of the PR and issue properly!!

@github-actions github-actions Bot added size/XL 500+ lines changed and removed size/XL 500+ lines changed labels Aug 10, 2026
@AbiramiR-27

Copy link
Copy Markdown
Contributor Author

@Ri1tik I thought I followed the standard template format, but could you please point out which specific part is missing or needs adjustment? I'll be happy to fix it right away!

@github-actions github-actions Bot added size/XL 500+ lines changed and removed size/XL 500+ lines changed labels Aug 10, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/pages/TeamsPage.jsx (2)

638-693: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Implement focus control for the assignment modal.

This overlay does not create a modal dialog. Focus remains on the previous control, and keyboard users can leave the modal and control background content. Use an accessible dialog with an accessible name, initial/contained focus, focus restoration, and Escape handling.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/TeamsPage.jsx` around lines 638 - 693, Update the assignModal
overlay around the assignment modal to use an accessible dialog with an
accessible name, trap keyboard focus within it, and move focus to the dialog or
its first actionable control when opened. Restore focus to the triggering
control when the modal closes, handle Escape to close it, and prevent background
content from receiving focus while open.

Source: Path instructions


117-190: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Rebuild the D3 graph when the SVG becomes available.

This effect exits without setting up svgRef.current while appLoading is true or model is missing. That is valid; the effect does not rerun when the page later renders the SVG because only teams and searchQuery are dependencies.

Add model and appLoading to this effect's dependency array, and update the cleanup dependency for simRef.current.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/TeamsPage.jsx` around lines 117 - 190, Update the D3 graph
useEffect in TeamsPage to include model and appLoading in its dependency array
so it reruns when the SVG becomes available or loading completes. Also update
the cleanup dependency handling for simRef.current, preserving the existing
graph setup and teardown behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/TeamsPage.jsx`:
- Around line 41-48: Update the useEffect that calls fetchOrgTeams to require
both orgName and pat before loading. When pat is absent, clear the team state
and return before setLoading or starting the request, while preserving the
existing behavior when authenticated.

In `@src/services/github.js`:
- Around line 215-230: Add a shared paginated GitHub list-fetch helper that
requests each page with per_page=100, follows subsequent pages, and aggregates
the cached responses before returning. Update fetchOrgTeams, fetchTeamMembers,
and fetchTeamRepos to use this helper while preserving fetchTeamRepos’s
healthScore mapping on the complete repository collection.

---

Outside diff comments:
In `@src/pages/TeamsPage.jsx`:
- Around line 638-693: Update the assignModal overlay around the assignment
modal to use an accessible dialog with an accessible name, trap keyboard focus
within it, and move focus to the dialog or its first actionable control when
opened. Restore focus to the triggering control when the modal closes, handle
Escape to close it, and prevent background content from receiving focus while
open.
- Around line 117-190: Update the D3 graph useEffect in TeamsPage to include
model and appLoading in its dependency array so it reruns when the SVG becomes
available or loading completes. Also update the cleanup dependency handling for
simRef.current, preserving the existing graph setup and teardown behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6bebf751-ade2-4bae-ad43-b2f964157bd8

📥 Commits

Reviewing files that changed from the base of the PR and between ea4c4fc and 7e87634.

📒 Files selected for processing (2)
  • src/pages/TeamsPage.jsx
  • src/services/github.js

Comment thread src/pages/TeamsPage.jsx
Comment thread src/services/github.js
@github-actions github-actions Bot added size/XL 500+ lines changed and removed size/XL 500+ lines changed labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request external-contributor External contributor frontend Frontend changes javascript JavaScript/TypeScript changes size/XL 500+ lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Interactive GitHub Teams & Membership Graph Explorer

2 participants