Skip to content

fix(preview): show error in preview when template processing fails#777

Open
harsh-na wants to merge 1 commit intoaccordproject:mainfrom
harsh-na:harsh-na/i94/fix-preview-error-state
Open

fix(preview): show error in preview when template processing fails#777
harsh-na wants to merge 1 commit intoaccordproject:mainfrom
harsh-na:harsh-na/i94/fix-preview-error-state

Conversation

@harsh-na
Copy link

@harsh-na harsh-na commented Mar 6, 2026

fix(preview): prevent stale agreement HTML from rendering when processing errors occur

Closes #774

This PR ensures that the Preview panel reflects the actual processing state of the template. Previously, when an error occurred during template/model/data processing, the Preview continued showing the last successfully generated agreement HTML, which created inconsistency between the editor state and the rendered output.

With this change, the Preview now displays the corresponding error message instead of stale content whenever a rebuild fails.

Changes

  • Added agreementError state to the global store to track processing errors.
  • Updated Preview rendering logic to display error messages instead of previously generated HTML when an error occurs.
  • Ensured the Preview stays consistent with the current template/model/data validity.
  • Updated related snapshot tests affected by the UI change.

Flags

  • Snapshot for the Footer component was updated due to styling changes detected during test runs.
  • This PR focuses on fixing Preview consistency; further improvements to structured error reporting across panels may follow.

Screenshots or Video

Previously I make some error, I only get the issue in Problem Panel
image

Now we are getting in the Preview Panel as well, which gives correct user experience

image

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

Signed-off-by: harshit <harshitgalaxy710@gmail.com>
@harsh-na harsh-na requested a review from a team as a code owner March 6, 2026 10:25
@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for ap-template-playground ready!

Name Link
🔨 Latest commit 2feb71b
🔍 Latest deploy log https://app.netlify.com/projects/ap-template-playground/deploys/69aaaba359a0050008291051
😎 Deploy Preview https://deploy-preview-777--ap-template-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@harsh-na
Copy link
Author

harsh-na commented Mar 7, 2026

@mttrbrts , I checked the logs, the reason is due to duplication of locator in Playwright Script. With ref. to my current feature branch I did the neccessary changes, which may segrgate the duplicate locators, still problem persists,
(keeping my Dev server on, Then only I tried running Playwright scripts on my Local)

I simply switch to main branch and run the tests, there also they are failing,
Thanks

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.

Preview Shows Stale Content When Template/Data Processing Fails

1 participant