Conversation
When federated shared folders are activated Since we can now edit it directly in the sharing modal
WalkthroughThis pull request updates French localization strings for share permissions, refactors the LinkRecipient component's UI by replacing a DropdownButton with a ghost-variant Button featuring a Gear icon, and modifies the BoxEditingRights component to conditionally render its trigger UI based on the 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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/ShareRestrictionModal/BoxEditingRights.jsx (1)
56-79: GateActionsMenuwith the same feature flag as the trigger.When the trigger is hidden, keeping
ActionsMenumounted creates an orphaned interaction path and extra work. Render both under the same condition.♻️ Proposed refactor
+ const showEditingRightsSelector = !flag('drive.federated-shared-folder.enabled') + return ( <> - {!flag('drive.federated-shared-folder.enabled') && ( - <Box - borderRadius="0.5rem" - border="1px solid var(--borderMainColor)" - ref={buttonRef} - > - <List className="u-p-0"> - <ListItem - button - size="large" - ellipsis={false} - onClick={toggleMenuDisplayed} - > - <ListItemIcon> - <Icon icon={PeopleIcon} /> - </ListItemIcon> - <ListItemText primary={textPrimary} secondary={textSecondary} /> - <ListItemIcon className="u-mr-half"> - <Icon icon={BottomIcon} /> - </ListItemIcon> - </ListItem> - </List> - </Box> - )} - - <ActionsMenu - ref={buttonRef} - open={isMenuDisplayed} - docs={[file]} - actions={actions} - autoClose - onClose={toggleMenuDisplayed} - /> + {showEditingRightsSelector && ( + <> + <Box + borderRadius="0.5rem" + border="1px solid var(--borderMainColor)" + ref={buttonRef} + > + <List className="u-p-0"> + <ListItem + button + size="large" + ellipsis={false} + onClick={toggleMenuDisplayed} + > + <ListItemIcon> + <Icon icon={PeopleIcon} /> + </ListItemIcon> + <ListItemText primary={textPrimary} secondary={textSecondary} /> + <ListItemIcon className="u-mr-half"> + <Icon icon={BottomIcon} /> + </ListItemIcon> + </ListItem> + </List> + </Box> + + <ActionsMenu + ref={buttonRef} + open={isMenuDisplayed} + docs={[file]} + actions={actions} + autoClose + onClose={toggleMenuDisplayed} + /> + </> + )} </> )Based on learnings, in federated-folder sharing the UI should avoid exposing unsupported sharing-management paths.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cozy-sharing/src/components/ShareRestrictionModal/BoxEditingRights.jsx` around lines 56 - 79, The ActionsMenu must be rendered only when the trigger is visible: wrap the ActionsMenu component with the same feature-flag condition used for the trigger (flag('drive.federated-shared-folder.enabled')) or move ActionsMenu inside the same conditional block so it is mounted/unmounted together with the Box/List trigger; ensure any props or refs it expects (e.g., buttonRef, toggleMenuDisplayed) are passed through after the move so toggleMenuDisplayed and ActionsMenu remain wired correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@packages/cozy-sharing/src/components/ShareRestrictionModal/BoxEditingRights.jsx`:
- Around line 56-79: The ActionsMenu must be rendered only when the trigger is
visible: wrap the ActionsMenu component with the same feature-flag condition
used for the trigger (flag('drive.federated-shared-folder.enabled')) or move
ActionsMenu inside the same conditional block so it is mounted/unmounted
together with the Box/List trigger; ensure any props or refs it expects (e.g.,
buttonRef, toggleMenuDisplayed) are passed through after the move so
toggleMenuDisplayed and ActionsMenu remain wired correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6a33e19a-6d57-45a3-a03a-bbd817b40630
📒 Files selected for processing (3)
packages/cozy-sharing/locales/fr.jsonpackages/cozy-sharing/src/components/Recipient/LinkRecipient.jsxpackages/cozy-sharing/src/components/ShareRestrictionModal/BoxEditingRights.jsx
Summary by CodeRabbit
Localization
UI Improvements