fix(cozy-sharing): Prioritize email over instance URL#3038
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Walkthrough
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.jsx (1)
6-34: ⚡ Quick winConsider adding PropTypes for type safety.
The component now accepts a new
📝 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
📒 Files selected for processing (4)
packages/cozy-sharing/src/components/Recipient/GroupRecipientDetailWithAccess.jsxpackages/cozy-sharing/src/components/Recipient/MemberRecipient.jsxpackages/cozy-sharing/src/components/Recipient/MemberRecipientLite.jsxpackages/cozy-sharing/src/components/Recipient/MemberRecipientStatus.jsx
237a2cc to
537656b
Compare
rezk2ll
left a comment
There was a problem hiding this comment.
we should have unit tests for the new behaviour
| if (isReady) { | ||
| text = instance | ||
| icon = ToTheCloudIcon | ||
| text = email || instance |
There was a problem hiding this comment.
for members without a Displayname, this will render the email twice for that member ( primary and secondary texts )
There was a problem hiding this comment.
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.
3f0f2dd to
2efc791
Compare
cozy-sharing 33.5.0 → 33.5.1 - linagora/cozy-libs#3038 - linagora/cozy-libs#3039
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
Bug Fixes
Refactor