Skip to content

Fix - TG: Featured Widget items overlap when pages have no featured image - #91

Open
rajatgautam755421 wants to merge 3 commits into
developfrom
fix/featured-widget-overlap
Open

rajatgautam755421 wants to merge 3 commits into
developfrom
fix/featured-widget-overlap

Conversation

@rajatgautam755421

Copy link
Copy Markdown

Same fix as themegrill/accelerate-pro#122 (themegrill/accelerate-pro#103, reported by @subin-shk).

Cause: a TG: Featured Widget item's title label is position: absolute; when the page has no featured image it is the item's only content, so the item collapses to 0px and all four items pile onto one spot. Fix: such items get a recent-work-no-image class and their label stays in normal flow. Items with an image are untouched.

Before After
before after

How to test: add TG: Featured Widget (Elementor or Appearance → Widgets) with 4 pages that have no featured image → before: one title visible; after: 4 side by side. Pages with images: unchanged.

Testing done: Elementor and classic sidebar, with/without images — no overlaps after; with-image layout unchanged. New @fresh spec (REST-built pages + widget, cleaned up) fails on develop, passes here.

PHPCS (repo phpcs.xml.dist): 0 violations on the added lines; file totals unchanged (171 errors / 23 warnings, pre-existing).

Changelog: Fix - TG: Featured Widget items overlapping when the selected pages have no featured image.

🤖 Generated with Claude Code

rajatgautam755421 and others added 2 commits October 1, 2026 11:07
…mage

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ng their column

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Improve fixture cleanup and surface cleanup or setup failures.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes overlapping TG: Featured Widget items when selected pages have no featured images.

Changes:

  • Adds a conditional no-image class.
  • Keeps no-image titles in normal flow.
  • Adds REST-based E2E regression coverage.
File Description
tests/​e2e/​specs/​smoke/​featured-widget.spec.ts Tests non-overlapping items and manages fixtures.
style.css Prevents no-image items from collapsing.
inc/​widgets/​accelerate-recent-work-widget.php Marks items without thumbnails.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +27 to +31
const id: string = (await created.json()).id;
// Over HTTP the new widget lands in Inactive Widgets; assigning the sidebar is a separate update.
const placed = await page.request.post(`/?rest_route=/wp/v2/widgets/${id}`, { headers: { ...headers, "X-HTTP-Method-Override": "PUT" }, data: { sidebar: "accelerate_right_sidebar" } });
expect(placed.ok(), `placing the widget failed: HTTP ${placed.status()}`).toBeTruthy();
return id;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Valid — fixed in 0341847. The helper now catches a failed placement, deletes the widget it just created, and rethrows. Verified by forcing the placement request to fail: no orphaned widget left; the normal run still passes.

@rajatgautam755421

Copy link
Copy Markdown
Author

Testing note — TG widgets can't be added from the Elementor panel on Elementor 4.3+

While testing this PR live, TG: Featured Widget couldn't be found in Elementor's widget panel or search. This is an Elementor change, not caused by this PR:

  • Elementor 4.3.0 (2026-09-22): "Tweak: Removed the WordPress section from the widget panel". In includes/widgets/wordpress.php, show_in_panel() now returns false (checked against the wordpress.org releases: 4.2.x and earlier list WordPress widgets in the panel; 4.3.0 / 4.3.1 don't). WordPress widgets have been hidden from panel search since 3.11.0.
  • All TG widgets are classic WordPress widgets, so on Elementor 4.3+ none of them (Featured Widget, Fun Facts, Team, Testimonial, Pricing Table, Our Clients…) can be newly added in Elementor. Widgets already on a page still render and stay editable, and can be copied/pasted.

To test this PR on Elementor 4.3+: use a page that already has the widget (or copy one onto another page), or test via Appearance → Widgets → Business Sidebar on a Business Template page — same bug, same fix.

This is outside #103, and will be raised as a separate issue (themegrill/accelerate-pro#103 has the details) (possible fix: register theme-side Elementor widget classes for the TG widgets with show_in_panel() returning true, keeping the same wp-widget-… names so existing pages keep working; longer term, native Elementor widgets).

… widget spec

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@deepench deepench left a comment

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.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants