Skip to content

feat(teams): enhance TeamCard with repository display and improved styling #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2025

Conversation

Ayyanaruto
Copy link
Contributor

@Ayyanaruto Ayyanaruto commented Mar 26, 2025

resolves #639

This pull request enhances the TeamsList component in the web-server project by improving the UI and adding new features for better user experience. The most significant changes include the addition of Avatar and AvatarGroup components, UI styling updates, and the introduction of the renderVisibleRepos function.

UI Enhancements:

New Features:

Shot-2025-03-26-040249

Summary by CodeRabbit

  • New Features

    • Enhanced the team profile view with a consolidated display of repository avatars and names.
    • Integrated tooltips for additional repository details.
  • Style

    • Refined layout with improved spacing, padding, and a dynamic hover effect for a more engaging user experience.
    • Updated text color for better visibility and alignment within the TeamCard component.

Copy link

coderabbitai bot commented Mar 26, 2025

Walkthrough

The pull request introduces a new function, renderVisibleRepos, within the TeamCard component in TeamsList.tsx. This function leverages Material-UI's AvatarGroup and Avatar components to display repository avatars along with their names. Additionally, FlexBox styling for the TeamCard has been refined by adjusting padding, minimum height, and hover effects. The previous repository count display has been replaced, while tooltip support for additional repositories remains intact.

Changes

File Change Summary
web-server/.../TeamsList.tsx Introduced renderVisibleRepos in TeamCard to display repository avatars and names; updated FlexBox styling (padding, min-height, hover effects) and integrated tooltips.

Sequence Diagram(s)

sequenceDiagram
    participant TeamCard
    participant renderVisibleRepos
    participant AvatarGroup
    participant Avatar
    TeamCard->>renderVisibleRepos: Invoke renderVisibleRepos()
    renderVisibleRepos->>AvatarGroup: Construct avatar container
    AvatarGroup->>Avatar: Render each repository's avatar
    renderVisibleRepos->>TeamCard: Return constructed layout with avatars and repository names
Loading

Assessment against linked issues

Objective Addressed Explanation
Enhance Team Section Card UI, including support for multiple repositories [#639]

Poem

I'm a rabbit, hopping with code delight,
Crafting avatars that shine so bright,
Each repo's tale now clearly told,
In a layout fresh and bold,
Happy hops for every pixel in sight! 🐇✨


📜 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 9d88ff8 and 55e5db1.

📒 Files selected for processing (1)
  • web-server/src/components/TeamsList.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web-server/src/components/TeamsList.tsx

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (1)
web-server/src/components/TeamsList.tsx (1)

212-240: Well-structured repository visualization component

The new renderVisibleRepos function effectively implements the repository display feature as mentioned in the PR objectives. The implementation is clean and follows React best practices.

Consider these minor improvements:

  1. The GitHub avatar URL uses size=20 but displays at 28x28px, which might reduce image quality
  2. Consider adding a fallback for missing repository avatars
-            src={`https://github.com/${repo.org_name}.png?size=20`}
+            src={`https://github.com/${repo.org_name}.png?size=28`}
+            alt={`${repo.name} repository`}
+            sx={{ 
+              bgcolor: 'grey.200'
+            }}
-        {visibleReposName.map((repo, index) => (
-          <span key={repo.id || repo.name}>
-            {repo.name}{index < visibleReposName.length - 1 ? ', ' : ''}
-          </span>
-        ))}
+        {visibleReposName.map(repo => repo.name).join(', ')}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b715c16 and 90be2cc.

📒 Files selected for processing (1)
  • web-server/src/components/TeamsList.tsx (3 hunks)
🔇 Additional comments (6)
web-server/src/components/TeamsList.tsx (6)

7-8: Clean addition of UI components

Good job adding the Avatar and AvatarGroup components from Material-UI. These are appropriate choices for displaying repository avatars as required by the PR objectives.


256-265: Enhanced card styling for better visual appeal

The styling improvements to the TeamCard component are excellent. The increased padding, defined minimum height, rounded corners, and subtle shadow effects create a more polished and modern UI. The hover state enhancement provides good interactive feedback.

The box-shadow transitions nicely between states, which improves the user experience.


267-282: Well-organized header section with improved typography

The team name header is now properly emphasized with the primary dark color, and the layout provides good separation between the title and action buttons.


284-292: Clear visual hierarchy with effective separator

Good use of the Divider component to create visual separation between sections. The repository count is now clearly emphasized with appropriate typography styling.


294-315: Excellent implementation of repository list with progressive disclosure

The implementation shows the visible repositories with avatars and names, while providing a "+X more" indicator for additional repositories. This pattern follows good UX principles for progressive disclosure of information.

The tooltip for showing additional repository names is a thoughtful addition that enhances usability without cluttering the UI.


318-327: Well-positioned call-to-action button

The "View DORA Metrics" button is appropriately placed at the bottom of the card, making it a clear call-to-action. The full-width styling and inclusion of the icon enhance its visibility and usability.

@dreamerchandra
Copy link

dreamerchandra commented Apr 8, 2025

@Ayyanaruto
Thanks for the PR. The new card is solid!

This is a very minute detail. Could you please move +2 to next to repo names, as shown in the second screenshot?
Also, the tooltip positioning is not aligned with the text

image image

Comment on lines 290 to 309
{Boolean(assignedReposToTeam.length) && (
<FlexBox col gap={1}>
{renderVisibleRepos}

{assignedReposToTeam.length > VISIBLE_REPOS_COUNT && (
<FlexBox
inline
sx={{
userSelect: 'none',
ml: 1
}}
title={<FlexBox maxWidth={'250px'}>{tooltipRepos}</FlexBox>}
>
<Line info>
+{assignedReposToTeam.length - VISIBLE_REPOS_COUNT} more
</Line>
</FlexBox>
</>
)}
</FlexBox>
</FlexBox>
</FlexBox>
<FlexBox col justifyBetween minHeight={'70px'} alignCenter>
<FlexBox
title={'View Dora Metrics'}
centered
width={'1.2em'}
maxWidth={'1.2em'}
pointer
onClick={() => onView(team)}
>
<DoraIcon />
)}
</FlexBox>
)}

Choose a reason for hiding this comment

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

Can we make the requested changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

Copy link
Contributor Author

@Ayyanaruto Ayyanaruto Apr 8, 2025

Choose a reason for hiding this comment

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

Hey @dreamerchandra I have made requested changes Sorry for taking this much time ,Let me know if the submitted code works for you or there is a better way to do it

@Ayyanaruto
Copy link
Contributor Author

@Ayyanaruto
Thanks for the PR. The new card is solid!

This is a very minute detail. Could you please move +2 to next to repo names, as shown in the second screenshot?
Also, the tooltip positioning is not aligned with the text

image image

Thanks man

dreamerchandra
dreamerchandra previously approved these changes Apr 8, 2025
@dreamerchandra
Copy link

awesome @Ayyanaruto

@dreamerchandra
Copy link

@Ayyanaruto linters are failing, could you take a look?

@Ayyanaruto
Copy link
Contributor Author

Ayyanaruto commented Apr 8, 2025

@Ayyanaruto linters are failing, could you take a look?

Sure , But I did ran yarn lint before pushing the code ,it didn't gave me any errors at that time , Is there any other command to find these linting errors first

@Ayyanaruto
Copy link
Contributor Author

It should work now
image

@dreamerchandra dreamerchandra merged commit c0eaf63 into middlewarehq:main Apr 9, 2025
4 checks passed
@dreamerchandra
Copy link

thanks @Ayyanaruto

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.

Issue: Enhance Team Section Card
2 participants