Skip to content

fix: add username truncation for common dashboard dropdown #2964

Merged
Saksham-Sirohi merged 2 commits intofossasia:devfrom
Saksham-Sirohi:username-truncation
Mar 31, 2026
Merged

fix: add username truncation for common dashboard dropdown #2964
Saksham-Sirohi merged 2 commits intofossasia:devfrom
Saksham-Sirohi:username-truncation

Conversation

@Saksham-Sirohi
Copy link
Copy Markdown
Collaborator

@Saksham-Sirohi Saksham-Sirohi commented Mar 23, 2026

Fixes part of #2965

Summary by Sourcery

New Features:

  • Use a standardized short user label in the profile dropdown instead of the full name to improve layout in the common dashboard header.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Mar 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Implements username truncation in the common profile dropdown by switching from displaying the full name directly to using a reusable short_user_label template filter, and ensuring the relevant template tag library is loaded.

File-Level Changes

Change Details Files
Use a reusable truncated/short username label in the common profile dropdown instead of the full name.
  • Load the custom event_tags template tag library in the common profile dropdown fragment so custom filters are available.
  • Replace direct use of request.user.get_full_name with the short_user_label template filter on request.user within the dropdown summary.
app/eventyay/common/templates/common/fragment_profile_dropdown.html

Possibly linked issues

  • #Truncate User Name in Dropdown Menu and Show First Name Only: The PR replaces full_name with short_user_label in the dropdown, implementing the issue’s truncated-first-name requirement.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider exposing the full get_full_name via a title attribute or similar on the <summary> or icon so truncated labels remain accessible (e.g., for screen readers and hover tooltips).
  • Ensure the short_user_label filter gracefully handles cases where request.user is anonymous or missing profile fields, since this template previously relied on get_full_name which is defined only for authenticated users.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider exposing the full `get_full_name` via a `title` attribute or similar on the `<summary>` or icon so truncated labels remain accessible (e.g., for screen readers and hover tooltips).
- Ensure the `short_user_label` filter gracefully handles cases where `request.user` is anonymous or missing profile fields, since this template previously relied on `get_full_name` which is defined only for authenticated users.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Saksham-Sirohi
Copy link
Copy Markdown
Collaborator Author

Screenshot 2026-03-23 at 10 39 20 PM

Copy link
Copy Markdown
Member

@ArnavBallinCode ArnavBallinCode left a comment

Choose a reason for hiding this comment

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

LGTM, this pr is only solving the username truncation issue from the entire issue, you could change it from fixes to partially solves

@Saksham-Sirohi Saksham-Sirohi requested a review from Sak1012 March 26, 2026 12:47
@Saksham-Sirohi Saksham-Sirohi merged commit 90a037a into fossasia:dev Mar 31, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Eventyay Next Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants