Skip to content

fix: wp7 compatibility#19

Open
Arukuen wants to merge 3 commits intodevelopfrom
fix-wp7-compatibility
Open

fix: wp7 compatibility#19
Arukuen wants to merge 3 commits intodevelopfrom
fix-wp7-compatibility

Conversation

@Arukuen
Copy link
Copy Markdown
Contributor

@Arukuen Arukuen commented Apr 8, 2026

fixes #20

Summary by CodeRabbit

  • Bug Fixes

    • Fixed spacing and sizing issues in various editor controls and popovers for consistent layout.
    • Restored bottom margins for target selector and property controls to prevent layout regressions.
    • Corrected text input heights for proper rendering.
  • Style

    • Added compatibility CSS tweaks for updated WordPress/editor styles.
  • UX

    • Improved rendering of the Live Preview toggle for more reliable display.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a97f11ca-c4ce-43ee-bdab-454c3f08fb9b

📥 Commits

Reviewing files that changed from the base of the PR and between ce8b0f0 and f64eee6.

📒 Files selected for processing (1)
  • src/editor/components/interaction-panel/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/editor/components/interaction-panel/index.js

📝 Walkthrough

Walkthrough

Adds 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 type property, and a ToggleControl JSX form was simplified.

Changes

Cohort / File(s) Summary
Styling: WP 7.0 compatibility
src/editor/components/add-interaction-popover/editor.scss, src/editor/components/target-selector/editor.scss, src/editor/editor.scss
Added CSS rules adjusting spacing/sizing for WP 7.0 (toggle-group height 84px; base-control field margin-bottom 8px; toggle control margin-bottom 12px; text input min-height 30px).
Target selector markup
src/editor/components/target-selector/index.js
Added className="interact-target-block-input" to the TextControl rendered for value.type === 'block' to enable CSS targeting.
Interaction panel props
src/editor/components/interaction-panel/index.js
For toggle options, create a copy of option and remove its type before spreading into ToggleControl, so type is not passed as a prop.
Timeline toggle JSX
src/editor/components/timeline/index.js
Replaced ToggleControl with explicit child label by a self-closing ToggleControl using the same label prop (JSX structure change only).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through styles and tiny props,
Nibbled margins, straightened spots,
A twitch, a tweak, a tidy pass —
Editor springs anew at last! ✨

🚥 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 'fix: wp7 compatibility' directly and clearly summarizes the main objective of the changeset: addressing WordPress 7.0 compatibility issues across multiple components and stylesheets.
Linked Issues check ✅ Passed The PR addresses WP 7.0 compatibility fixes [#20] through CSS overrides and component adjustments for layout regressions in WordPress 7.0, matching the linked issue objective.
Out of Scope Changes check ✅ Passed All changes are scoped to WordPress 7.0 compatibility: CSS rules for component spacing/sizing and a prop removal to prevent type inheritance in ToggleControl, all directly addressing #20.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-wp7-compatibility

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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🤖 Pull request artifacts

file commit
pr19-interactions-19-merge.zip f64eee6

github-actions bot added a commit that referenced this pull request Apr 8, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between cec35db and ce8b0f0.

📒 Files selected for processing (6)
  • src/editor/components/add-interaction-popover/editor.scss
  • src/editor/components/interaction-panel/index.js
  • src/editor/components/target-selector/editor.scss
  • src/editor/components/target-selector/index.js
  • src/editor/components/timeline/index.js
  • src/editor/editor.scss

Comment on lines +87 to +89
.interact-add-interaction-popover .components-toggle-group-control{
height: 84px;
} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
.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.

Comment on lines +145 to +161
.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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

github-actions bot added a commit that referenced this pull request Apr 8, 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.

WP 7.0 Compatibility Fixes

1 participant