Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds WordPress 7.0 compatibility CSS and small editor component tweaks: new/adjusted SCSS rules across several editor files, TextControl gets a className for targeting, ToggleControl props are passed without a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
🤖 Pull request artifacts
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/editor/components/add-interaction-popover/editor.scss`:
- Around line 87-89: The rule for .interact-add-interaction-popover
.components-toggle-group-control uses a fixed height (height: 84px) which can
clip dynamic toggle content; remove the fixed height and replace it with a
flexible approach such as using min-height or max-height with overflow:auto (or
simply rely on padding/margins) so the .components-toggle-group-control can grow
with varying option counts and labels and avoid inaccessible options.
In `@src/editor/components/interaction-panel/index.js`:
- Around line 405-407: interactionConfig.options is being mutated during render
by `delete option.type`, which corrupts shared config state; instead, avoid
in-place mutation by creating a non-mutating copy of each option before removing
`type` (e.g. use destructuring `const { type, ...safeOption } = option` or
`const safeOption = { ...option }; delete safeOption.type`) wherever `option`
from `interactionConfig.options` is used to choose/render controls (e.g. around
the ToggleControl handling). Replace direct `delete option.type` with the
copy-based approach so `interactionConfig.options` remains unchanged across
renders.
In `@src/editor/editor.scss`:
- Around line 145-161: The current rules target global Gutenberg classes; scope
them to the plugin's container by prefixing each selector with the interactions
editor wrapper (use the existing .interact-property-control container or a
single top-level plugin class like .interact-editor if present). Replace the
global selectors with scoped ones such as ".interact-property-control
.components-toggle-control", ".interact-property-control
.components-text-control__input" (keep the min-height override but scoped),
".interact-property-control .components-select-control
.components-base-control__field", and keep ".interact-property-control
.components-base-control__field" as-is so these overrides only affect controls
inside the plugin UI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2229f22a-3a11-438f-85b5-e693a9df0baa
📒 Files selected for processing (6)
src/editor/components/add-interaction-popover/editor.scsssrc/editor/components/interaction-panel/index.jssrc/editor/components/target-selector/editor.scsssrc/editor/components/target-selector/index.jssrc/editor/components/timeline/index.jssrc/editor/editor.scss
| .interact-add-interaction-popover .components-toggle-group-control{ | ||
| height: 84px; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Avoid fixed height on dynamic toggle-group content.
At Line 88, height: 84px can clip content when option count/labels vary (the option list is conditional). Prefer flexible sizing to prevent inaccessible options.
💡 Safer sizing
-.interact-add-interaction-popover .components-toggle-group-control{
- height: 84px;
-}
+.interact-add-interaction-popover .components-toggle-group-control {
+ min-height: 84px;
+ height: auto;
+}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .interact-add-interaction-popover .components-toggle-group-control{ | |
| height: 84px; | |
| } | |
| .interact-add-interaction-popover .components-toggle-group-control { | |
| min-height: 84px; | |
| height: auto; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/editor/components/add-interaction-popover/editor.scss` around lines 87 -
89, The rule for .interact-add-interaction-popover
.components-toggle-group-control uses a fixed height (height: 84px) which can
clip dynamic toggle content; remove the fixed height and replace it with a
flexible approach such as using min-height or max-height with overflow:auto (or
simply rely on padding/margins) so the .components-toggle-group-control can grow
with varying option counts and labels and avoid inaccessible options.
| .components-toggle-control { | ||
| margin-bottom: 12px; | ||
| } | ||
|
|
||
| // Text control min-height changed from 30px to 40px. | ||
| .components-text-control__input { | ||
| min-height: 30px !important; | ||
| } | ||
|
|
||
| // Select control field loses its margin bottom. | ||
| .components-select-control .components-base-control__field { | ||
| margin-bottom: 8px; | ||
| } | ||
|
|
||
| .interact-property-control .components-base-control__field { | ||
| margin-bottom: 8px; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Scope WP 7.0 style overrides to plugin containers.
Lines 145-161 currently target global Gutenberg classes. This can unintentionally restyle controls outside the Interactions UI.
💡 Scope the overrides
-// Toggle control loses its margin bottom.
-.components-toggle-control {
- margin-bottom: 12px;
-}
-
-// Text control min-height changed from 30px to 40px.
-.components-text-control__input {
- min-height: 30px !important;
-}
-
-// Select control field loses its margin bottom.
-.components-select-control .components-base-control__field {
- margin-bottom: 8px;
-}
-
-.interact-property-control .components-base-control__field {
- margin-bottom: 8px;
-}
+.interact-sidebar,
+.interact-popover,
+.interact-add-interaction-popover {
+ .components-toggle-control {
+ margin-bottom: 12px;
+ }
+
+ .components-text-control__input {
+ min-height: 30px !important;
+ }
+
+ .components-select-control .components-base-control__field {
+ margin-bottom: 8px;
+ }
+
+ .interact-property-control .components-base-control__field {
+ margin-bottom: 8px;
+ }
+}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/editor/editor.scss` around lines 145 - 161, The current rules target
global Gutenberg classes; scope them to the plugin's container by prefixing each
selector with the interactions editor wrapper (use the existing
.interact-property-control container or a single top-level plugin class like
.interact-editor if present). Replace the global selectors with scoped ones such
as ".interact-property-control .components-toggle-control",
".interact-property-control .components-text-control__input" (keep the
min-height override but scoped), ".interact-property-control
.components-select-control .components-base-control__field", and keep
".interact-property-control .components-base-control__field" as-is so these
overrides only affect controls inside the plugin UI.
fixes #20
Summary by CodeRabbit
Bug Fixes
Style
UX