[PR #318] [MERGED] Render product asset images in shop previews and onboarding pages #623

Closed
opened 2026-03-13 21:00:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/318
Author: @AJaySi
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @AJaySi

Base: mainHead: codex/update-product-asset-rendering-in-templates


📝 Commits (1)

  • 2079cf6 Add product asset rendering for shop previews

📊 Changes

2 files changed (+102 additions, -0 deletions)

View changed files

backend/api/onboarding_utils/website_automation_service.py (+51 -0)
backend/services/website_automation_service.py (+51 -0)

📄 Description

Motivation

  • Product assets were only exposed as links in previews, which prevents image previews from appearing in page bodies and onboarding content.
  • Onboarding shop pages should show inline product images (markdown ![alt](url)) so previews and generated content include visuals.
  • The OG image selection already prefers product asset images, so the page body should also surface those same images for consistent previews.

Description

  • Added backend/services/website_automation_service.py with WebsiteAutomationService._render_shop_assets_html to render product assets as <img> tags wrapped in anchor links and optional <figcaption> when a caption/label is present.
  • Implemented _normalize_asset (service) to extract URLs, alt text and caption from common shapes (url, asset_url, image_url, image, alt, title, name, caption, label) and handle string assets.
  • Added backend/api/onboarding_utils/website_automation_service.py with _render_shop_page and _render_product_assets_markdown to include product asset markdown entries and image embeds (![alt](url)) in onboarding shop previews.
  • Both renderers return empty output when no assets are present and normalize a variety of asset payload shapes for robust handling.

Testing

  • No automated tests were run for this change.

Codex Task


Note

Low Risk
Adds new, self-contained rendering helpers with HTML escaping and no changes to auth, persistence, or request handling; risk is mainly around display/formatting regressions for unexpected asset payloads.

Overview
Adds product-asset rendering for shop content in both onboarding and preview contexts. Onboarding now builds shop markdown that includes a Product Assets section with both link entries and inline image embeds (![alt](url)), while the new WebsiteAutomationService renders the same assets as escaped HTML <img> thumbnails wrapped in links and optional <figcaption>.

Both paths introduce shared-style asset normalization to accept multiple payload shapes (url/asset_url/image_url/image, plus alt/title/name, and caption/label for HTML) and skip empty/invalid assets.

Written by Cursor Bugbot for commit 2079cf6869. Configure here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/318 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/update-product-asset-rendering-in-templates` --- ### 📝 Commits (1) - [`2079cf6`](https://github.com/AJaySi/ALwrity/commit/2079cf68697edbc7bbe4da84577a54ecac0b5d6f) Add product asset rendering for shop previews ### 📊 Changes **2 files changed** (+102 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `backend/api/onboarding_utils/website_automation_service.py` (+51 -0) ➕ `backend/services/website_automation_service.py` (+51 -0) </details> ### 📄 Description ### Motivation - Product assets were only exposed as links in previews, which prevents image previews from appearing in page bodies and onboarding content. - Onboarding shop pages should show inline product images (markdown `![alt](url)`) so previews and generated content include visuals. - The OG image selection already prefers product asset images, so the page body should also surface those same images for consistent previews. ### Description - Added `backend/services/website_automation_service.py` with `WebsiteAutomationService._render_shop_assets_html` to render product assets as `<img>` tags wrapped in anchor links and optional `<figcaption>` when a caption/label is present. - Implemented `_normalize_asset` (service) to extract URLs, alt text and caption from common shapes (`url`, `asset_url`, `image_url`, `image`, `alt`, `title`, `name`, `caption`, `label`) and handle string assets. - Added `backend/api/onboarding_utils/website_automation_service.py` with `_render_shop_page` and `_render_product_assets_markdown` to include product asset markdown entries and image embeds (`![alt](url)`) in onboarding shop previews. - Both renderers return empty output when no assets are present and normalize a variety of asset payload shapes for robust handling. ### Testing - No automated tests were run for this change. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_6982bfd48598832880cee72cabee1ebf) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Adds new, self-contained rendering helpers with HTML escaping and no changes to auth, persistence, or request handling; risk is mainly around display/formatting regressions for unexpected asset payloads. > > **Overview** > Adds product-asset rendering for shop content in both onboarding and preview contexts. Onboarding now builds shop markdown that includes a **Product Assets** section with both link entries and inline image embeds (`![alt](url)`), while the new `WebsiteAutomationService` renders the same assets as escaped HTML `<img>` thumbnails wrapped in links and optional `<figcaption>`. > > Both paths introduce shared-style asset normalization to accept multiple payload shapes (`url`/`asset_url`/`image_url`/`image`, plus `alt`/`title`/`name`, and `caption`/`label` for HTML) and skip empty/invalid assets. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2079cf68697edbc7bbe4da84577a54ecac0b5d6f. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:00:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#623
No description provided.