Conversation
WalkthroughThe changes made to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/editor/src/core/extensions/custom-image/components/image-block.tsx (1)
185-188: Approve changes with a minor suggestion.The modifications to
showImageUtilsand the introduction ofshowImageResizeralign well with the PR objective. This change allows the image utilities (including the full screen toolbar) to be displayed in read-only instances while keeping the resizer limited to editable instances.A minor suggestion for improved readability:
Consider extracting the common conditions into a separate variable:
const imageReady = remoteImageSrc && initialResizeComplete; const showImageUtils = imageReady; const showImageResizer = editor.isEditable && imageReady;This would make the code more DRY and easier to maintain.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/editor/src/core/extensions/custom-image/components/image-block.tsx (2 hunks)
🔇 Additional comments (2)
packages/editor/src/core/extensions/custom-image/components/image-block.tsx (2)
244-244: LGTM: Consistent use ofshowImageResizer.The update to use
showImageResizerfor conditional rendering of the image resizer is consistent with the logic defined earlier. This ensures that the resizer is only displayed when appropriate (i.e., in editable instances with a fully loaded remote image).
Line range hint
1-270: Overall assessment: Changes align well with PR objective.The modifications made to the
CustomImageBlockcomponent successfully address the PR objective of enabling the full screen toolbar option for images in read-only instances. The key changes include:
- Separating the logic for displaying image utilities from the editor's editability.
- Introducing a new variable
showImageResizerto maintain the editor's editability check for the resizer.- Updating the conditional rendering to use these new variables consistently.
These changes allow the image utilities (including the full screen toolbar) to be accessible in read-only instances while keeping the resizer functionality limited to editable instances. The implementation is clean and focused, with no unnecessary changes to other parts of the file.
Description
Show the full screen toolbar option of images in read only instances as well!
Credits
Thanks mikhaella from discord for the catch!
Summary by CodeRabbit
New Features
Bug Fixes