Skip to content

Internal: Fix conversion banner placeholder shifting admin buttons [ED-25235] - #683

Merged
Ntnelbaba merged 2 commits into
mainfrom
internal/ED-25235-conversion-banner-placeholder
Aug 20, 2026
Merged

Internal: Fix conversion banner placeholder shifting admin buttons [ED-25235]#683
Ntnelbaba merged 2 commits into
mainfrom
internal/ED-25235-conversion-banner-placeholder

Conversation

@Ntnelbaba

@Ntnelbaba Ntnelbaba commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the empty #ehe-admin-cb placeholder rendered in PHP via in_admin_header, which sat between the page title and .page-title-action and shifted buttons in Editor One admin layouts.
  • Create and mount the banner in JavaScript only after REST confirms welcome content exists (config.welcome.title), so suppressed banners leave no DOM node.
  • Place the banner after .page-title-action on standard list-table screens (fallback: after the configured heading selector); preserve existing before and beforeWrap placement for special screens.
  • Pass pre-fetched admin settings into AdminProvider to avoid a duplicate REST request; add Playwright regression tests for the main flows.

Jira

ED-25235

Test plan

  • Playwright: Pages list — no #ehe-admin-cb when Elementor suppresses welcome config; title row stays aligned
  • Playwright: Hello settings page loads; banner (if present) sits after .page-title-action
  • Playwright: Plugins page title row intact when banner is absent
  • Manual: Free Elementor (no Pro) on Hello settings — Go Pro banner appears below title row, not between h1 and buttons
  • Manual: Dismiss banner via AJAX — does not reappear on reload
  • Manual: before: true screens (templates library, system info) — banner still appears before anchor
  • Manual: Upload-plugin uploader (beforeWrap) — banner appears before .wrap

Labels

patch

Made with Cursor

✨ PR Description

1. Problem & Context

Banner's fixed width and PHP-injected placeholder DOM were causing admin buttons to shift. Moved rendering to JavaScript with dynamic insertion logic to avoid layout thrashing and ensure proper positioning.

2. What Changed (Where)

  • conversion-banner.php: Removed render_conversion_banner() method and in_admin_header hook; banner now created client-side.
  • hello-elementor-conversion-banner.js: Refactored to fetch config via API, dynamically create container with visibility hidden, then inject at computed insertion point.
  • admin-provider.js: Added initialSettings prop to skip redundant API call when config already fetched.
  • conversion-banner-layout.test.ts: Added E2E tests validating banner placement doesn't displace page-title-action buttons.

3. How It Works

Init function fires on DOMContentLoaded, fetches config via REST API, creates hidden container, calls insertBanner() to locate insertion point (beforeWrap > before selector > after page-title-action > after selector), renders React app, then reveals container via useLayoutEffect. This prevents reflow of admin buttons since container is invisible during DOM insertion.

4. Risks

Minor: API fetch failure silently aborts (no retry). Banner won't render if initialSettings.welcome.title missing, but test coverage validates this. Insertion logic depends on specific DOM selectors being present—validate across WordPress admin pages where selectors differ (dashboard special-cases to #wpbody-content .wrap h1).

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Mount the conversion banner in JavaScript only when welcome config exists,
place it after the page title action by default, and add Playwright regression
tests for suppressed and visible placement flows.

Ref: ED-25235
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

Hello Elementor Build

Last updated at: 20260819.0919
Version: 3.4.9

✅ Hello Elementor build is ready for download.

You can download the latest build from the link below:

🔗 hello-elementor.3.4.9.zip

The build is available for 7 days.

CI uses free Elementor without guaranteed Go Pro suppression on list
tables, so stub admin-settings to assert no DOM mount deterministically.

Ref: ED-25235
Co-authored-by: Cursor <cursoragent@cursor.com>
},
};

test.describe('Conversion banner flows [ED-25235]', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do have a ticket 25235?

@Ntnelbaba
Ntnelbaba merged commit cbe44cc into main Aug 20, 2026
44 checks passed
@Ntnelbaba
Ntnelbaba deleted the internal/ED-25235-conversion-banner-placeholder branch August 20, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants