Skip to content

fix(groups): display group name in manage users drawer title#5161

Closed
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-drawer-title-for-group-editing
Closed

fix(groups): display group name in manage users drawer title#5161
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-drawer-title-for-group-editing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

  • Add groupName prop to GroupManageUsers component interface
  • Update drawer title to Users of {groupName} using i18n interpolation (not template literal key injection)
  • Add fallback t('this group') when groupName is undefined
  • Pass group.group_name as groupName prop in GroupPopover.jsx
Original prompt

This section details on the original issue you should resolve

<issue_title>When you're editing the users of a group, you've no clue which group you're editing</issue_title>
<issue_description>## Description

When you're editing the users of a group, you've no clue which group you're editing

Image

Should be in the title of the modal.</issue_description>

<agent_instructions>This is a frontend-only fix in openaev-front/.

The issue: when editing users of a group, the drawer/modal title does not show which group is being edited.

Fix: In the drawer/modal component that handles editing group users, update the title to display "Users of {groupName}" where {groupName} is the name of the group being edited.

Look for the group users drawer component in the frontend code (likely in a component related to groups/teams management). The group name should already be available in the component props or context — just pass it to the drawer title.

Keep the fix minimal and focused. Do not change any backend code.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@jborozco Replace the title of this drawer by "Users of [user group name]"

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: RomuDeuxfois <53513584+RomuDeuxfois@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix drawer title to indicate group being edited fix(groups): display group name in manage users drawer title Mar 18, 2026
Copilot AI requested a review from RomuDeuxfois March 18, 2026 07:26
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.11%. Comparing base (497585e) to head (902d61d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5161      +/-   ##
============================================
+ Coverage     57.07%   57.11%   +0.03%     
- Complexity     4676     4677       +1     
============================================
  Files          1014     1014              
  Lines         30103    30103              
  Branches       2192     2192              
============================================
+ Hits          17182    17192      +10     
+ Misses        11942    11933       -9     
+ Partials        979      978       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RomuDeuxfois
Copy link
Copy Markdown
Member

🔍 Architecture Review — Frontend & Security

Good fix, minimal and focused — exactly what we want. However, I spotted 2 issues that need to be addressed before merging:


🔴 Issue 1 — i18n key injection (security + broken translations)

title={t(`Users of ${groupName}`)}

groupName is interpolated directly into the i18n key. This causes two problems:

  1. Broken i18n — The key "Users of My Group" will never exist in translation files. Each group name generates a different key, so translations will always fall back to the raw string.
  2. Potential XSS risk — If group_name contains HTML/JS characters, they are injected as-is into the drawer title.

Recommended fix:

// Option A — simple concatenation (safe, translatable)
title={`${t('Users of')} ${groupName}`}

// Option B — i18n interpolation (preferred if the i18n framework supports it)
title={t('Users of {{name}}', { name: groupName })}

🟡 Issue 2 — No fallback if groupName is undefined

If group.group_name is undefined for any reason, the title will render "Users of undefined".

Recommended fix:

title={`${t('Users of')} ${groupName ?? t('this group')}`}

Summary

# Severity Issue Fix
1 🔴 Must fix i18n key injection — breaks translations + XSS risk Use string concatenation or i18n interpolation
2 🟡 Should fix No fallback for undefined group name Add nullish coalescing with fallback label

Both fixes are one-liners. Happy to approve once addressed 👍

Copy link
Copy Markdown
Member

@RomuDeuxfois RomuDeuxfois left a comment

Choose a reason for hiding this comment

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

Two issues to fix before merge — see detailed comment on the PR. The i18n key injection is a must-fix (broken translations + XSS risk), and the missing fallback for undefined group name is a should-fix.

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 improves the admin “Manage users” drawer UX by including the current group’s name in the drawer title, so admins can immediately see which group they are editing.

Changes:

  • Added a groupName prop to GroupManageUsers and used it in the drawer title.
  • Passed group.group_name from GroupPopover into GroupManageUsers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
openaev-front/src/admin/components/settings/groups/GroupPopover.jsx Passes the group’s name to the users management drawer.
openaev-front/src/admin/components/settings/groups/GroupManageUsers.tsx Adds groupName prop and updates the drawer title to include it.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread openaev-front/src/admin/components/settings/groups/GroupManageUsers.tsx Outdated
…roup name in drawer title

Co-authored-by: RomuDeuxfois <53513584+RomuDeuxfois@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 18, 2026

🔍 Architecture Review — Frontend & Security

Good fix, minimal and focused — exactly what we want. However, I spotted 2 issues that need to be addressed before merging:...

Fixed in 9edd3b1:

  1. i18n interpolation: Replaced the template literal key with proper i18n placeholder interpolation — t('Users of {groupName}', { groupName: ... }) — matching the existing pattern used in the codebase (e.g. ExecutorDocumentationLink.tsx).
  2. Fallback for undefined: Added ?? t('this group') so the title gracefully falls back to "Users of this group" if group_name is ever absent.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Thank you for your contribution. This PR is but one step away from being ready for merging: all commits must be PGP-signed. To get started, please see https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

@RomuDeuxfois
Copy link
Copy Markdown
Member

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 18, 2026

@copilot apply changes based on the comments in this thread

The changes from that review thread were already applied in commit 9edd3b1 — the title now uses t('Users of {groupName}', { groupName }) with a stable i18n key and proper placeholder interpolation. The runtime ?? t('this group') fallback was subsequently removed in 902d61d since the groupName: string TypeScript prop type ensures the value is always present at compile time.

@RomuDeuxfois RomuDeuxfois deleted the copilot/fix-drawer-title-for-group-editing branch March 18, 2026 15:01
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.

When you're editing the users of a group, you've no clue which group you're editing

3 participants