Fix - TG: Featured Widget items overlap when pages have no featured image - #91
rajatgautam755421 wants to merge 3 commits into
Conversation
…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>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Improve fixture cleanup and surface cleanup or setup failures.
Review effort: Lite
Findings: 1
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.
| 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; |
There was a problem hiding this comment.
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.
|
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:
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 |
… widget spec Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

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 arecent-work-no-imageclass and their label stays in normal flow. Items with an image are untouched.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
@freshspec (REST-built pages + widget, cleaned up) fails ondevelop, 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