Skip to content

[WIKI-391] chore: handle deactivated user display name in version history#7171

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix/version-history-user
Jun 6, 2025
Merged

[WIKI-391] chore: handle deactivated user display name in version history#7171
sriramveeraghanta merged 1 commit intopreviewfrom
fix/version-history-user

Conversation

@aaryan610
Copy link
Member

@aaryan610 aaryan610 commented Jun 5, 2025

Description

This PR fixes version history user display name when the version was created by a deactivated user.

Now, the text Deactivated user is rendered instead of the current implementation of an empty space.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • New Features
    • Added a localized fallback text for user display names in version history and dropdowns, ensuring "deactivated user" is shown when the creator or owner is missing or deactivated.
  • Bug Fixes
    • Improved consistency in displaying user information by preventing empty or missing names in relevant UI components.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

Walkthrough

The changes introduce a fallback mechanism for displaying user names in various components. When a user's display name is missing or the user is deactivated, a localized "deactivated user" string is shown instead of leaving the field blank. This update affects dropdown items, dropdown labels, and sidebar list items.

Changes

Files/Groups Change Summary
web/core/components/core/description-versions/dropdown-item.tsx Adds fallback to localized "deactivated user" string if version creator's display name is missing.
web/core/components/core/description-versions/dropdown.tsx Adds fallback to localized "deactivated user" string for last editor's display name in dropdown label.
web/core/components/pages/version/sidebar-list-item.tsx Uses translation hook and fallback string for missing owner display name in sidebar list item.

Suggested labels

ready_to_merge

Suggested reviewers

  • prateekshourya29
  • sriramveeraghanta

Poem

A dropdown here, a sidebar there,
Sometimes a name is just not there.
But now, with care, a string appears—
“Deactivated user,” it cheers!
No more blanks, just friendly text,
The UI’s neat, users aren’t vexed.
🐇✨


📜 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 986f29d and 6b13d0f.

📒 Files selected for processing (3)
  • web/core/components/core/description-versions/dropdown-item.tsx (1 hunks)
  • web/core/components/core/description-versions/dropdown.tsx (1 hunks)
  • web/core/components/pages/version/sidebar-list-item.tsx (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
web/core/components/core/description-versions/dropdown-item.tsx (1)
packages/i18n/src/store/index.ts (1)
  • t (211-232)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
web/core/components/core/description-versions/dropdown.tsx (1)

43-44: LGTM! Proper fallback implementation for deactivated users.

The implementation correctly uses the nullish coalescing operator to provide a localized fallback when the user display name is null or undefined, which addresses the PR objective of showing "Deactivated user" instead of empty space.

web/core/components/core/description-versions/dropdown-item.tsx (1)

34-34: LGTM! Consistent fallback implementation.

The change maintains consistency with the Avatar component's name prop (line 28) and follows the same pattern as other components in this PR. The fallback ensures deactivated users are properly displayed instead of showing undefined/null values.

web/core/components/pages/version/sidebar-list-item.tsx (3)

3-4: LGTM! Proper import addition for translation support.

The import is correctly placed and necessary for implementing the deactivated user fallback functionality.


26-27: LGTM! Proper translation hook initialization.

The translation hook is correctly initialized following the established pattern in other components.


47-47: LGTM! Consistent fallback implementation across components.

The implementation follows the same pattern as the other components in this PR, ensuring a consistent user experience when displaying deactivated user information.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 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.

@makeplane
Copy link

makeplane bot commented Jun 5, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@sriramveeraghanta sriramveeraghanta merged commit 950fcfd into preview Jun 6, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/version-history-user branch June 6, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants