Skip to content

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

Open
AbiramiR-27 wants to merge 7 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 7 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: 30 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: 1c2ecda3-fc88-44f3-895a-43b3acd244d1

📥 Commits

Reviewing files that changed from the base of the PR and between f21220b and eb52574.

📒 Files selected for processing (1)
  • src/pages/TeamsPage.jsx

Walkthrough

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

Changes

Teams Explorer

Layer / File(s) Summary
Authenticated team data services
src/services/github.js
Adds PAT-scoped caching, paginated team fetchers, repository health enrichment, membership updates, cache invalidation, and distinct rate-limit and forbidden errors.
Teams route and data loading
src/App.jsx, src/components/Navbar.jsx, src/pages/TeamsPage.jsx
Adds the route and navigation link. TeamsPage loads organization data with bounded concurrency, cancellation protection, partial-error retention, demo data, and loading or error states.
Team graph and exploration
src/pages/TeamsPage.jsx
Builds and filters team, contributor, and repository nodes. It renders the D3 force graph with search, selection, tooltips, metrics, and keyboard controls.
Interactive membership assignment
src/pages/TeamsPage.jsx, src/services/github.js
Supports contributor selection and drag-and-drop assignment. The page validates duplicates, confirms changes, updates GitHub, and updates local state.

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: Fetch 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: Select or drag contributor to 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 reviewers: ri1tik

Poem

A rabbit maps each GitHub team,
With members, repos, and a stream.
Drag, confirm, and states align,
The graph now links each design.
Teams Explorer is ready to gleam! 🐇

🚥 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 summarizes the Teams Explorer visualization and membership editing changes.
Linked Issues check ✅ Passed The implementation addresses issue #150 by adding team data APIs, an interactive graph, and drag-and-drop membership updates.
Out of Scope Changes check ✅ Passed The changes are limited to the Teams Explorer route, navigation, UI, GitHub team services, and membership management.
✨ 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

AbiramiR-27 commented Aug 10, 2026

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

Ri1tik commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

Thanks for checking, But I wanted to highlight one important part: template specifically asks for a screen recording/demo when changes affect the UI or user experience. Visual context is extremely important for UI-related changes. No matter how detailed the written description is, a short recording helps reviewers quickly understand the actual behavior, flow, and final appearance without needing to pull the branch, set up the environment, and manually test every change. Please make sure to attach a screen recording for future UI changes. It will help validate the implementation faster and give better feedback.

@AbiramiR-27

Copy link
Copy Markdown
Contributor Author

Thanks for the clarification, @Ri1tik . I'll include the screen recording / screenshots.

@github-actions github-actions Bot removed the size/XL 500+ lines changed label Aug 11, 2026
@github-actions github-actions Bot added the size/XL 500+ lines changed label Aug 11, 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

🤖 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 124-159: Add a valid GitHub profile URL for every demo member in
the teams data used by TeamsPage, including the members in the visible team
fixtures, using each member’s login to populate html_url. Ensure the tooltip’s
existing profile-link rendering receives a destination in sandbox mode without
changing its behavior.
- Around line 169-218: Update the modal focus-management effect around
handleKeyDown so Escape is ignored while assigning is true, and add assigning to
the effect dependencies. Filter the queried focusable controls to enabled
elements, and when none remain, prevent Tab from leaving the modal and focus
dialogRef.current instead of returning.
🪄 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: a098d277-eda6-418b-971e-bdaa98ce42fb

📥 Commits

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

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

Comment thread src/pages/TeamsPage.jsx
Comment thread src/pages/TeamsPage.jsx Outdated
@github-actions github-actions Bot added size/XL 500+ lines changed and removed size/XL 500+ lines changed labels Aug 11, 2026
@AbiramiR-27

Copy link
Copy Markdown
Contributor Author

@Ri1tik ,

Because organization team details are private and restricted by GitHub, external contributors who are not members of the organization cannot fetch this data (which results in a 403 Forbidden error).

To ensure anyone can test and verify this feature:

  1. I have implemented a "Load Sandbox Demo Data" fallback button directly inside the permission error blocks and warning alerts.
  2. Clicking it loads a pre-configured, offline mockup dataset mapping intersecting teams (Core Maintainers, GSoC Developers, and Documentation Team), member avatars, and repository health indicators.
  3. This renders the full interactive D3 network graph, so you can test drag-and-drop assignments, hover tooltips, and keyboard selector controls without needing live credentials.

If you are a member of the organization and configure a valid Personal Access Token (PAT) with read:org (or write:org for drag-and-drop updates) scopes enabled under Settings, the dashboard will load the live teams data automatically.

Here is a screenshot demonstrating the interactive graph page with demo data loaded:
image
image
image
image

@Ri1tik

Ri1tik commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

I do not think this feature is going with our intention of building this application much. So I need to review more in-order to take any further steps into this feature. And now are you get why i asked to follow the attach the recording!!!

@AbiramiR-27

Copy link
Copy Markdown
Contributor Author

Yes I understand that... I have explained the core vision and intention behind this feature below to help clarify how it fits into OrgExplorer:

Mapping Internal Structure: While OrgExplorer provides high-level insights into overall contributors and repositories, it currently lacks visibility into internal organization hierarchy (e.g., sub-teams, working groups, or specialized teams).

Visual Team & Permission Auditing: For larger open-source organizations, this provides maintainers and mentors with a single-page visual map to audit team memberships, check cross-team overlaps, and monitor repository access scopes at a glance.

Streamlined Membership Management: The drag-and-drop and keyboard-accessible interface offers an intuitive way to manage team rosters without navigating through multiple deep GitHub settings menus.

Testing with Sandbox Demo Data:
Since GitHub Organization Team APIs require specific elevated permissions that external contributors do not possess, I added a "Load Sandbox Demo Data" option directly on the fallback warning state. This allows anyone reviewing or testing the UI to experience the full interactive D3 graph, tooltips, and keyboard selector offline without needing special organization credentials.

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