Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/editor/components/add-interaction-popover/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ h4.components-menu-group__label {
.interface-interface-skeleton__header:has(.interact-add-interaction-popover) {
z-index: 99 !important;
}

.interact-add-interaction-popover .components-toggle-group-control{
height: 84px;
}
Comment on lines +87 to +89
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.

6 changes: 5 additions & 1 deletion src/editor/components/interaction-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ const InteractionPanel = props => {
{ interactionConfig.options.map( option => {
const { type, condition } = option
const propsToPass = {}
const optionToPass = { ...option }

const Tag = type === 'number' ? NumberControl
: type === 'select' ? SelectControl
Expand All @@ -402,6 +403,9 @@ const InteractionPanel = props => {
} else { // Default value
propsToPass.checked = option.placeholder || false
}
// Wordpress 7.0 Compatibility
// ToggleControl is messed up in Wordpress 7.0 when type prop is added.
delete optionToPass.type
}

// Conditionally display the option.
Expand All @@ -416,7 +420,7 @@ const InteractionPanel = props => {

return (
<Tag
{ ...option }
{ ...optionToPass }
key={ option.name }
value={ editedInteraction.options?.[ option.name ] || '' }
onChange={ value => {
Expand Down
7 changes: 7 additions & 0 deletions src/editor/components/target-selector/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@
}
}
}

/* Wordpress 7.0 compatibility */

// Text control losses its margin bottom.
.interact-target-block-input .components-base-control__field {
margin-bottom: 8px;
}
1 change: 1 addition & 0 deletions src/editor/components/target-selector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ const TargetSelector = props => {
<FlexLayout justifyContent="start">
{ isHorizontal && targetButton }
<TextControl
className="interact-target-block-input"
id="interact-target-block-input"
label={ __( 'Block Anchor / ID', 'interactions' ) }
value={ value.value }
Expand Down
4 changes: 1 addition & 3 deletions src/editor/components/timeline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,9 +1147,7 @@ const Timeline = props => {
return ! value
} )
} }
>
{ __( 'Live Preview', 'interactions' ) }
</ToggleControl>
/>
) }
</BaseControl>
)
Expand Down
21 changes: 21 additions & 0 deletions src/editor/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,24 @@
.interact-add-interaction-button-wrapper {
--wp-components-color-accent: #05f;
}

/* Wordpress 7.0 compatibility */

// 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;
}
Comment on lines +145 to +161
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.

Loading