Skip to content

[Dashboard][UI] - User's teams on profile page#885

Merged
madster456 merged 4 commits intodevfrom
dashboard/ui/user-teams
Sep 11, 2025
Merged

[Dashboard][UI] - User's teams on profile page#885
madster456 merged 4 commits intodevfrom
dashboard/ui/user-teams

Conversation

@madster456
Copy link
Copy Markdown
Collaborator

@madster456 madster456 commented Sep 6, 2025

Adds new team section on user profile pages in the dashboard.


Important

Adds a new UserTeamsSection to display user's teams on the profile page in page-client.tsx.

  • New Features:
    • Adds UserTeamsSection component in page-client.tsx to display user's teams on profile page.
    • Displays a table with Team ID, Display Name, Created At, and an action to open each team in a new tab.
    • Shows an empty-state card when no teams are found.
    • Integrated the section after the ContactChannelsSection on the user page.

This description was created by Ellipsis for e3080a9. You can customize this summary. It will automatically update as commits are pushed.


Review by RecurseML

🔍 Review performed on 9318e2b..7b9e098

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx

Need help? Join our Discord

Summary by CodeRabbit

  • New Features
    • Added a "Teams" section to the user page showing teams the user belongs to.
    • Displays a table with Team ID, Display Name, Created At, and an action to open each team in a new tab.
    • Shows an empty-state card when no teams are found.
    • Integrated the section after the Contact Channels area on the user page.

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
stack-backend Ready Ready Preview Comment Sep 11, 2025 8:12pm
stack-dashboard Ready Ready Preview Comment Sep 11, 2025 8:12pm
stack-demo Ready Ready Preview Comment Sep 11, 2025 8:12pm
stack-docs Ready Ready Preview Comment Sep 11, 2025 8:12pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 6, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a UserTeamsSection component and prop type to the user detail page; it uses user.useTeams() to fetch teams, displays a placeholder if empty or a table of teams with a "View Team" link to /projects/{projectId}/teams/{team.id}, and is placed after Contact Channels.

Changes

Cohort / File(s) Summary
User page UI — Teams section
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx
Adds UserTeamsSection component and UserTeamsSectionProps type; uses user.useTeams() to fetch teams; renders header/subtitle, empty-state card when no teams, or a table with columns Team ID, Display Name, Created At, and a View Team action that opens /projects/{projectId}/teams/{team.id} in a new tab; inserts the section into UserPage after Contact Channels.

Sequence Diagram(s)

sequenceDiagram
    actor Viewer as User
    participant UserPage
    participant UserTeamsSection
    participant Hook as user.useTeams()
    participant Router as Router/Links

    Viewer->>UserPage: Open user detail page
    UserPage->>UserTeamsSection: Render with { user }
    UserTeamsSection->>Hook: Fetch teams for user
    alt Teams found
        Hook-->>UserTeamsSection: teams[]
        UserTeamsSection-->>Viewer: Render table rows
        Viewer->>Router: Click "View Team"
        Router-->>Viewer: Open /projects/{projectId}/teams/{teamId} (new tab)
    else No teams
        Hook-->>UserTeamsSection: []
        UserTeamsSection-->>Viewer: Render "No teams found" placeholder
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[Dashboard][UI] - User's teams on profile page" accurately and concisely summarizes the primary change — adding a user's teams section to the dashboard profile page — and is specific and scan-friendly for reviewers.
Description Check ✅ Passed The PR description includes the repository template header and provides a clear, detailed summary of the new UserTeamsSection, its table columns, empty-state behavior, integration point on the user page, and supporting artifacts (Loom video and RecurseML review), so it is largely complete for reviewers.

Poem

A hop, a click, I seek each team,
I list their names beneath moonbeam.
If none appear, I gently say,
“No teams found” — then bounce away. 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eca2aaf and e3080a9.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build (22.x)
  • GitHub Check: setup-tests
  • GitHub Check: all-good
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: docker
  • GitHub Check: docker
  • GitHub Check: build (22.x)
  • GitHub Check: Security Check
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dashboard/ui/user-teams

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 and usage tips.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR adds a new UserTeamsSection component to the user profile page in the dashboard, displaying teams that a user belongs to in a table format. The component is integrated into the existing UserPage component between the ContactChannelsSection and MetadataSection.

The new section follows the established design patterns of other profile sections, displaying team information including:

  • Team ID (truncated for display)
  • Team display name
  • Creation date
  • A "View Team" action that opens the team page in a new tab

The implementation includes proper empty state handling when a user has no team memberships and maintains consistency with the existing UI components and styling patterns used throughout the dashboard. This enhancement provides administrators with direct visibility into a user's team associations without requiring navigation away from the user profile, improving the overall user management workflow.

The change integrates seamlessly with the existing codebase structure, utilizing the same UI components (Table, TableBody, TableCell, etc.) and following the same architectural patterns as other sections on the page.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it only adds read-only functionality without modifying existing behavior
  • Score reflects a simple, well-structured addition that follows established patterns and doesn't introduce any breaking changes or complex logic
  • No files require special attention as the implementation is straightforward and follows existing conventions

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx (2)

875-877: Prefer consistent, readable date formatting

Use the existing fromNow helper with a tooltip for the exact timestamp to align with the rest of the page.

- {team.createdAt.toLocaleDateString()}
+ <span title={team.createdAt.toLocaleString()}>
+   {fromNow(team.createdAt)}
+ </span>

879-889: Single action in dropdown adds friction

With only “View Team”, consider rendering a small inline “View” button/link to reduce clicks. Keep dropdown if you expect more actions soon.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9318e2b and 7b9e098.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
{apps/dashboard,apps/dev-launchpad,packages/stack-ui,packages/react}/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

For blocking alerts and errors in UI, do not use toast notifications; use alerts instead

Files:

  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Prefer ES6 Map over Record when representing key–value collections

Files:

  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx
{apps/dashboard,apps/dev-launchpad,packages/stack-ui,packages/react}/**/*.{tsx,jsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

Keep hover/click animations snappy; avoid pre-transition delays on hover and apply transitions after the action (e.g., fade-out on hover end)

Files:

  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx
🧬 Code graph analysis (1)
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx (2)
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/use-admin-app.tsx (1)
  • useAdminApp (27-34)
packages/stack-ui/src/components/data-table/cells.tsx (1)
  • ActionCell (72-123)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: all-good
  • GitHub Check: docker
  • GitHub Check: setup-tests
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: build (22.x)
  • GitHub Check: build (22.x)
  • GitHub Check: docker
  • GitHub Check: restart-dev-and-test
  • GitHub Check: Security Check
🔇 Additional comments (3)
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx (3)

827-897: LGTM: Clear section structure and integration

Good use of existing table/ActionCell patterns and empty state copy. Overall, the section reads well and matches surrounding UX.


950-950: LGTM: Section placement

Placing Teams after Contact Channels is sensible and consistent with the page’s information hierarchy.


833-845: Confirm useTeams() loading and error states
I couldn’t locate its definition in the codebase—please verify its return shape (including any loading or error cases) and wrap the teams list render with a loading placeholder and an alert for blocking errors.

Copy link
Copy Markdown
Contributor

@N2D4 N2D4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a screenshot or loom to the PR description?

@N2D4 N2D4 removed their assignment Sep 10, 2025
@madster456
Copy link
Copy Markdown
Collaborator Author

can you add a screenshot or loom to the PR description?

I have added a loom video to the description.

@madster456 madster456 merged commit 32b42ad into dev Sep 11, 2025
18 of 19 checks passed
@madster456 madster456 deleted the dashboard/ui/user-teams branch September 11, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants