Skip to content

Conversation

@Alex04412
Copy link
Member

Gör så att komite märken visas upp på deras komite sida på chalmers.it

@Alex04412 Alex04412 requested a review from GAsplund as a code owner December 5, 2025 19:12
@Alex04412 Alex04412 requested review from Copilot and removed request for GAsplund December 5, 2025 19:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds committee badges (avatars) to committee pages on chalmers.it. The implementation creates a new GroupAvatar component that displays super group avatars using the Gamma API, following the existing pattern for displaying group-related images.

  • Adds getSuperGroupAvatarURL method to GammaService for fetching super group avatar URLs
  • Creates new GroupAvatar component to display committee badges with fallback image support
  • Integrates the component into the group detail page

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/services/gammaService.ts Adds static method to generate super group avatar URLs, following existing URL generation patterns
src/components/GroupAvatar/GroupAvatar.tsx New component for displaying group avatars with debugging code that should be removed
src/components/GroupAvatar/GroupAvatar.module.scss Styles for the avatar component including debugging styles that should be removed
src/app/[locale]/(groups)/groups/[id]/page.tsx Integrates GroupAvatar component into group pages with conditional rendering that needs improvement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 85 to 88
{<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The fragment wrapper {...} is unnecessary here. You can directly render the GroupAvatar component without wrapping it in curly braces and a fragment.

Suggested change
{<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>}
<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>

Copilot uses AI. Check for mistakes.
Comment on lines 85 to 88
{<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Passing an empty string as groupAvatarUrl when gammaGroup?.superGroup.id is falsy could cause the FallbackImage component to attempt fetching an invalid URL. Consider conditionally rendering the GroupAvatar component only when a valid superGroup.id exists, similar to how member rendering is handled above (lines 65-84).

Suggested change
{<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>}
{gammaGroup?.superGroup.id && (
<GroupAvatar
groupAvatarUrl={GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id)}
groupName={group.prettyName}
/>
)}

Copilot uses AI. Check for mistakes.
import styles from './GroupAvatar.module.scss';

const GroupAvatar = ({
groupAvatarUrl,
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

There is trailing whitespace after the comma. Please remove it to maintain code consistency.

Suggested change
groupAvatarUrl,
groupAvatarUrl,

Copilot uses AI. Check for mistakes.
Comment on lines 16 to 21
.url {
margin-top: 0.5rem;
font-size: 0.75rem;
color: var(--muted-color, #666);
word-break: break-all;
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

These styles are for debugging purposes and should be removed before merging to production.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Member

@GAsplund GAsplund left a comment

Choose a reason for hiding this comment

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

Looks good overall, I have one small change request. Check separate comment.

Comment on lines 85 to 88
{<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>}
<GroupAvatar
groupAvatarUrl={gammaGroup?.superGroup.id ? GammaService.getSuperGroupAvatarURL(gammaGroup.superGroup.id) : ''}
groupName={group.prettyName}
/>

Copy link
Member Author

@Alex04412 Alex04412 Dec 5, 2025

Choose a reason for hiding this comment

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

Ehm jag tryckte på commit suggestion och nu runnar inte koden.. ;( vet inte varför

Copy link
Member

Choose a reason for hiding this comment

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

Vad får du för felmeddelande?

Copy link

Copilot AI commented Dec 5, 2025

@Alex04412 I've opened a new pull request, #181, to work on those changes. Once the pull request is ready, I'll request review from you.

Alex04412 and others added 4 commits December 5, 2025 21:04
* Initial plan

* Remove debugging URL display and styles from GroupAvatar component

Co-authored-by: Alex04412 <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Alex04412 <[email protected]>
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.

3 participants