Skip to content

Conversation

@ianpaschal
Copy link
Owner

@ianpaschal ianpaschal commented Aug 5, 2025

See: #152

Summary by CodeRabbit

  • New Features

    • Introduced a unified user display name field, ensuring consistent display of user names throughout the app.
    • Added a new user data visibility level: "community".
  • Bug Fixes

    • Improved handling of user display names and avatar URLs in account menus and profile displays.
  • Refactor

    • Simplified and centralized user display name and visibility logic, removing redundant utility functions.
    • Updated search and sorting features to use the new display name field.
    • Streamlined user data redaction and visibility checks for more consistent privacy handling.
  • Style

    • Removed obsolete styles related to tournament competitor cards.
  • Chores

    • Cleaned up unused components and utility files related to tournament competitor cards and user display name formatting.
    • Updated release management scripts for improved workflow.

@vercel
Copy link

vercel bot commented Aug 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
combat-command ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 6:22am

@coderabbitai
Copy link

coderabbitai bot commented Aug 5, 2025

Walkthrough

This change refactors user display name handling across the codebase, centralizing the logic into a consistent displayName property on user objects. Multiple utility functions for generating display names are removed, and all references are updated to use the new property. Additional changes include enhancements to user data visibility logic, updates to user-related types, and removal of the TournamentCompetitorCard component and its associated files.

Changes

Cohort / File(s) Change Summary
User Display Name Refactor
src/utils/common/getUserDisplayNameString.ts, src/utils/common/getUserDisplayNameReact.tsx, src/components/AccountMenu/AccountMenu.tsx, src/components/AuthProvider/AuthProvider.context.ts, src/components/FowV4MatchResultDetails/FowV4MatchResultDetails.hooks.ts, src/components/FowV4MatchResultForm/components/CommonFields.hooks.ts, src/components/FowV4MatchResultForm/components/SelectPlayerDialog.tsx, src/components/FowV4MatchResultForm/components/TournamentPlayersFields.utils.ts, src/components/IdentityBadge/IdentityBadge.hooks.tsx, src/components/MatchResultComments/MatchResultComments.tsx, src/components/MatchResultLikes/MatchResultLikes.tsx, src/pages/UserProfilePage/UserProfilePage.tsx, src/utils/common/getTournamentCompetitorDisplayName.ts
Removed custom display name utilities and updated all usages to reference the displayName property on user objects directly.
User Data Visibility and Redaction
convex/_model/users/_helpers/checkUserRelationshipLevel.ts, convex/_model/users/_helpers/compareVisibilityLevels.ts, convex/_model/users/_helpers/formatUserRealName.ts, convex/_model/users/_helpers/redactUser.ts, convex/common/userDataVisibilityLevel.ts
Introduced relationship-level abstraction for user data visibility, new comparison and formatting helpers, and updated redaction logic to use these abstractions. Added 'community' to visibility levels.
User Type and Query Updates
convex/_model/users/queries/getCurrentUser.ts, convex/_model/users/index.ts, src/api.ts
Updated user query to return enriched user objects with avatarUrl and displayName, and exported new types.
User Search and Sorting
convex/_model/users/queries/getUsers.ts, convex/_model/tournamentCompetitors/_helpers/sortTournamentCompetitorsByName.ts
Updated user search to use displayName instead of individual name fields and modified tournament competitor sorting to use displayName.
Avatar Handling
convex/_model/users/actions/setUserDefaultAvatar.ts, src/components/AvatarEditable/AvatarEditable.tsx
Changed avatar checks from storage ID to URL for determining avatar presence.
TournamentCompetitorCard Component Removal
src/components/TournamentCompetitorCard/TournamentCompetitorCard.tsx, src/components/TournamentCompetitorCard/TournamentCompetitorCard.hooks.tsx, src/components/TournamentCompetitorCard/TournamentCompetitorCard.module.scss, src/components/TournamentCompetitorCard/index.ts
Deleted the TournamentCompetitorCard component, its hooks, styles, and index export.
Release Script
scripts/finishRelease.js
Modified release script to use fast-forward-only merge for release branch and removed develop branch merge logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • The review involves moderate complexity due to the widespread refactor of display name handling, introduction of new visibility logic, and deletion of a component with associated files. While many changes are mechanical, careful attention is required for the new abstractions and their integration across user-related logic.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d44c388 and 9de47fa.

⛔ Files ignored due to path filters (1)
  • convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing (30)
  • convex/_model/tournamentCompetitors/_helpers/sortTournamentCompetitorsByName.ts (1 hunks)
  • convex/_model/users/_helpers/checkUserRelationshipLevel.ts (1 hunks)
  • convex/_model/users/_helpers/compareVisibilityLevels.ts (1 hunks)
  • convex/_model/users/_helpers/formatUserRealName.ts (1 hunks)
  • convex/_model/users/_helpers/redactUser.ts (2 hunks)
  • convex/_model/users/actions/setUserDefaultAvatar.ts (1 hunks)
  • convex/_model/users/index.ts (1 hunks)
  • convex/_model/users/queries/getCurrentUser.ts (2 hunks)
  • convex/_model/users/queries/getUsers.ts (1 hunks)
  • convex/common/userDataVisibilityLevel.ts (1 hunks)
  • scripts/finishRelease.js (1 hunks)
  • src/api.ts (1 hunks)
  • src/components/AccountMenu/AccountMenu.tsx (2 hunks)
  • src/components/AuthProvider/AuthProvider.context.ts (1 hunks)
  • src/components/AvatarEditable/AvatarEditable.tsx (1 hunks)
  • src/components/FowV4MatchResultDetails/FowV4MatchResultDetails.hooks.ts (1 hunks)
  • src/components/FowV4MatchResultForm/components/CommonFields.hooks.ts (1 hunks)
  • src/components/FowV4MatchResultForm/components/SelectPlayerDialog.tsx (2 hunks)
  • src/components/FowV4MatchResultForm/components/TournamentPlayersFields.utils.ts (1 hunks)
  • src/components/IdentityBadge/IdentityBadge.hooks.tsx (2 hunks)
  • src/components/MatchResultComments/MatchResultComments.tsx (1 hunks)
  • src/components/MatchResultLikes/MatchResultLikes.tsx (1 hunks)
  • src/components/TournamentCompetitorCard/TournamentCompetitorCard.hooks.tsx (0 hunks)
  • src/components/TournamentCompetitorCard/TournamentCompetitorCard.module.scss (0 hunks)
  • src/components/TournamentCompetitorCard/TournamentCompetitorCard.tsx (0 hunks)
  • src/components/TournamentCompetitorCard/index.ts (0 hunks)
  • src/pages/UserProfilePage/UserProfilePage.tsx (1 hunks)
  • src/utils/common/getTournamentCompetitorDisplayName.ts (1 hunks)
  • src/utils/common/getUserDisplayNameReact.tsx (0 hunks)
  • src/utils/common/getUserDisplayNameString.ts (0 hunks)
💤 Files with no reviewable changes (6)
  • src/components/TournamentCompetitorCard/index.ts
  • src/utils/common/getUserDisplayNameString.ts
  • src/utils/common/getUserDisplayNameReact.tsx
  • src/components/TournamentCompetitorCard/TournamentCompetitorCard.module.scss
  • src/components/TournamentCompetitorCard/TournamentCompetitorCard.tsx
  • src/components/TournamentCompetitorCard/TournamentCompetitorCard.hooks.tsx

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

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 sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@ianpaschal ianpaschal changed the base branch from main to develop August 5, 2025 06:22
@ianpaschal ianpaschal merged commit f408261 into develop Aug 5, 2025
3 checks passed
@ianpaschal ianpaschal deleted the 152-refactor-user-data-visibility-relationships-cherry-picked branch August 5, 2025 06:25
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