Skip to content

Comments

fix: Update descriptive text content on product/color change during image regeneration#724

Open
NirajC-Microsoft wants to merge 1 commit intomicrosoft:devfrom
NirajC-Microsoft:psl-cornercasefix
Open

fix: Update descriptive text content on product/color change during image regeneration#724
NirajC-Microsoft wants to merge 1 commit intomicrosoft:devfrom
NirajC-Microsoft:psl-cornercasefix

Conversation

@NirajC-Microsoft
Copy link
Contributor

@NirajC-Microsoft NirajC-Microsoft commented Feb 19, 2026

Purpose

When a user regenerates an image with a different product/color (e.g., changing from "Porcelain Mist" to "Pine Shadow"), the image and product label updated correctly, but the descriptive text content (headline, body copy, tagline, CTA) still referenced the old color name. Additionally, navigating away from the conversation and returning would revert to the stale text from CosmosDB.

This PR ensures that when a product/color change is detected during image regeneration:

  1. Frontend (App.tsx): All text_content fields are immediately updated via case-insensitive find-and-replace of the old product name with the new one, giving the user instant visual feedback.
  2. Backend (app.py): Before persisting generated_content to CosmosDB, the regenerate endpoint compares old vs. new selected_products and replaces the old product name in text_content. This guarantees the updated text is restored correctly when the user navigates back to the conversation.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant