Skip to content

fix(cozy-sharing): Prioritize email over instance URL#3038

Merged
doubleface merged 2 commits into
masterfrom
fix/mailOnSharingMembers
Jun 17, 2026
Merged

fix(cozy-sharing): Prioritize email over instance URL#3038
doubleface merged 2 commits into
masterfrom
fix/mailOnSharingMembers

Conversation

@doubleface

@doubleface doubleface commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Remove all icons from MemberRecipientStatus and display email instead of instance URL for sharing recipients

https://app.notion.com/p/linagora/Sharing-modal-Don-t-display-cloud-icon-and-display-email-38162718bad180d6a979cb34bc56c313

Summary by CodeRabbit

Release Notes

  • New Features

    • Sharing recipient lists now show recipient email and name details in their status text.
  • Bug Fixes

    • Recipient email addresses now display correctly across recipient list views.
  • Refactor

    • Simplified recipient status rendering to a single text element.
    • Updated recipient status logic to localize invitation states more consistently and handle missing identity fields.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@doubleface, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8fcb80c9-694d-4f39-879d-05918f08ce14

📥 Commits

Reviewing files that changed from the base of the PR and between 3f0f2dd and 2efc791.

📒 Files selected for processing (5)
  • packages/cozy-sharing/src/components/Recipient/GroupRecipientDetailWithAccess.jsx
  • packages/cozy-sharing/src/components/Recipient/MemberRecipient.jsx
  • packages/cozy-sharing/src/components/Recipient/MemberRecipientLite.jsx
  • packages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.jsx
  • packages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.spec.jsx

Walkthrough

MemberRecipientStatus is updated to accept email and name props. For ready recipients (isMe, ready, or owner), the component now displays email || instance instead of only instance, with conditional logic that renders an empty string when neither identity field is available. Icon-related imports and the surrounding flex container markup are removed; the component now returns a single Typography element with the computed status text. Status-based text logic also handles mail-not-sent with i18n and defaults pending for unknown statuses. Three caller components — GroupRecipientDetailWithAccess, MemberRecipient, and MemberRecipientLite — are each updated to pass the recipient's email (and name where applicable) to MemberRecipientStatus. A comprehensive test suite verifies text resolution across status and identity field combinations.

Suggested reviewers

  • JF-Cozy
  • rezk2ll
  • zatteo
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: prioritizing email display over instance URLs in the MemberRecipientStatus component, which is the core functional change across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mailOnSharingMembers

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.jsx (1)

6-34: ⚡ Quick win

Consider adding PropTypes for type safety.

The component now accepts a new email prop but doesn't define PropTypes. While not strictly required, adding PropTypes would improve maintainability and provide runtime validation.

📝 Proposed PropTypes definition
+import PropTypes from 'prop-types'
 import React from 'react'

 import Typography from 'cozy-ui/transpiled/react/Typography'
 export default MemberRecipientStatus
+
+MemberRecipientStatus.propTypes = {
+  status: PropTypes.string,
+  isMe: PropTypes.bool,
+  instance: PropTypes.string,
+  email: PropTypes.string,
+  typographyProps: PropTypes.object
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.jsx`
around lines 6 - 34, The MemberRecipientStatus component accepts multiple props
(status, isMe, instance, email, typographyProps) but lacks PropTypes definition
for runtime type validation. Add a PropTypes definition block after the
MemberRecipientStatus function to validate each prop type: status should be a
string, isMe and the boolean flags should be booleans, instance and email should
be strings (or allow null/undefined), and typographyProps should be an object
for the Material-UI Typography component props.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.jsx`:
- Around line 6-34: The MemberRecipientStatus component accepts multiple props
(status, isMe, instance, email, typographyProps) but lacks PropTypes definition
for runtime type validation. Add a PropTypes definition block after the
MemberRecipientStatus function to validate each prop type: status should be a
string, isMe and the boolean flags should be booleans, instance and email should
be strings (or allow null/undefined), and typographyProps should be an object
for the Material-UI Typography component props.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: afcb6d8a-f000-4329-a241-2b835ac22f62

📥 Commits

Reviewing files that changed from the base of the PR and between 34a9396 and 237a2cc.

📒 Files selected for processing (4)
  • packages/cozy-sharing/src/components/Recipient/GroupRecipientDetailWithAccess.jsx
  • packages/cozy-sharing/src/components/Recipient/MemberRecipient.jsx
  • packages/cozy-sharing/src/components/Recipient/MemberRecipientLite.jsx
  • packages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.jsx

@doubleface doubleface force-pushed the fix/mailOnSharingMembers branch from 237a2cc to 537656b Compare June 17, 2026 10:22

@rezk2ll rezk2ll left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should have unit tests for the new behaviour

if (isReady) {
text = instance
icon = ToTheCloudIcon
text = email || instance

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for members without a Displayname, this will render the email twice for that member ( primary and secondary texts )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now when primary text is email, we hide the secondary text

Remove all icons from MemberRecipientStatus and display email
instead of instance URL for sharing recipients
When a recipient has no public_name or name field, getDisplayName
falls back to the email for the primary text. The secondary text
rendered by MemberRecipientStatus was also showing the email,
producing a duplicate.

Pass the raw recipient name through a new optional prop so
MemberRecipientStatus can suppress the email in the secondary text
when it would duplicate the primary, while still showing the
instance when there is no email at all.
@doubleface doubleface force-pushed the fix/mailOnSharingMembers branch from 3f0f2dd to 2efc791 Compare June 17, 2026 12:43
@doubleface doubleface requested a review from rezk2ll June 17, 2026 12:44
@doubleface doubleface merged commit 800f091 into master Jun 17, 2026
3 checks passed
@doubleface doubleface deleted the fix/mailOnSharingMembers branch June 17, 2026 12:55
doubleface added a commit to linagora/twake-drive that referenced this pull request Jun 17, 2026
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.

3 participants