Skip to content

Added resolveViewCreator(members, view) that uses findWorkspaceMember…#53

Merged
nazarli-shabnam merged 1 commit into
mainfrom
51-fix-profile-picture-in-project-views
Mar 22, 2026
Merged

Added resolveViewCreator(members, view) that uses findWorkspaceMember…#53
nazarli-shabnam merged 1 commit into
mainfrom
51-fix-profile-picture-in-project-views

Conversation

@nazarli-shabnam
Copy link
Copy Markdown
Member

This pull request refactors how view creator information (name and avatar) is resolved and displayed in the ViewsPage component. Instead of using separate maps for names and avatars, the logic is centralized into a new helper function, and the UI now uses the standardized Avatar component for rendering creator avatars.

Refactoring and UI improvements:

  • Replaced separate memoized maps for member names and avatars with a single resolveViewCreator helper function, which determines the appropriate display name and avatar URL for a view creator based on workspace member data. [1] [2] [3]
  • Updated the UI to use the Avatar component for displaying creator avatars, ensuring consistent styling and fallback handling. [1] [2]

Code cleanup:

@nazarli-shabnam nazarli-shabnam linked an issue Mar 22, 2026 that may be closed by this pull request
@nazarli-shabnam nazarli-shabnam requested review from Copilot and martian56 and removed request for Copilot March 22, 2026 08:59
@nazarli-shabnam nazarli-shabnam self-assigned this Mar 22, 2026
@nazarli-shabnam nazarli-shabnam added the bug Something isn't working label Mar 22, 2026
@nazarli-shabnam nazarli-shabnam added this to the Deadline milestone Mar 22, 2026
Copy link
Copy Markdown
Contributor

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 PR refactors how “view creator” display data (label + avatar) is derived and rendered on the project ViewsPage, centralizing the logic into a helper and switching avatar rendering to the shared Avatar UI component to address incorrect/missing profile pictures (issue #51).

Changes:

  • Added resolveViewCreator(members, view) to derive creator label + avatar URL using findWorkspaceMemberByUserId and getImageUrl.
  • Removed the previous memoized “name by id” / “avatar by id” maps and the manual initials/avatar rendering.
  • Updated the list row UI to render creator avatars via the standardized Avatar component.

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

Comment on lines +700 to +703
const { label: creatorLabel, avatarSrc: creatorAvatarSrc } = resolveViewCreator(
members,
v,
);
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

resolveViewCreator(members, v) performs findWorkspaceMemberByUserId, which linearly scans members for every row render. This is an O(sortedViews × members) lookup and is a performance regression vs the previous memoized maps. Consider building a memoized lookup (e.g., Map keyed by normalized userId/memberId) once per members change and have resolveViewCreator use that map (or pass the already-resolved member into the helper).

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

@Rafetikus Rafetikus left a comment

Choose a reason for hiding this comment

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

Good job!

Copy link
Copy Markdown
Member

@Rafetikus Rafetikus left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Copy Markdown
Member

@Rafetikus Rafetikus left a comment

Choose a reason for hiding this comment

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

Brilliant!

Copy link
Copy Markdown
Member

@martian56 martian56 left a comment

Choose a reason for hiding this comment

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

Well done!

@nazarli-shabnam nazarli-shabnam merged commit 85a50bc into main Mar 22, 2026
11 checks passed
@martian56 martian56 deleted the 51-fix-profile-picture-in-project-views branch May 2, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix profile picture in project views

4 participants