Skip to content

Live preview new tab ssr issue#502

Merged
contentstackMridul merged 5 commits into18th-sept-2025-releasefrom
live-preview-new-tab-ssr-issue
Sep 16, 2025
Merged

Live preview new tab ssr issue#502
contentstackMridul merged 5 commits into18th-sept-2025-releasefrom
live-preview-new-tab-ssr-issue

Conversation

@contentstackMridul
Copy link
Copy Markdown
Contributor

Live preview new tab ssr issue

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 16, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 72.39% 9280 / 12818
🔵 Statements 72.39% 9280 / 12818
🔵 Functions 72.23% 333 / 461
🔵 Branches 84.1% 1169 / 1390
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/livePreview/eventManager/postMessageEvent.hooks.ts 78.41% 88.23% 75% 78.41% 80-98, 144-145, 158, 167, 180-188
Generated in workflow #546 for commit e65d15c by the Vitest Coverage Report Action

it("should reload window when ssr is true and no event_type", () => {
// Set URL to include live_preview parameter so reload path is taken
mockWindow.location.href = "https://example.com?live_preview=old-hash";
it("should reload window when ssr is true and no event_type and all params present", () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@contentstackMridul Just want to know that whether this test was newly added by us? or the live preview used to work like this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@KANE-99, earlier the test was checking for the live preview hash only, but ideally we should check for all the params in the SSR case


if (contentTypeUid && entryUid) {
// TODO: we should not use this function. Instead we should have sideEffect run automatically when we set the config.
console.log("setConfigFromParams", contentTypeUid, entryUid);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

remove this console

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

if (contentTypeUid && entryUid) {
// TODO: we should not use this function. Instead we should have sideEffect run automatically when we set the config.
console.log("setConfigFromParams", contentTypeUid, entryUid);
// setConfigFromParams(`?content_type_uid=${contentTypeUid}&entry_uid=${entryUid}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

remove this unwanted comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread CODEOWNERS
@@ -1 +1,11 @@
* @contentstack/security-admin
* @contentstack/ghost-pr-reviewers
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are this changes from main branch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes

Copy link
Copy Markdown

@KANE-99 KANE-99 left a comment

Choose a reason for hiding this comment

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

LGTM

@contentstackMridul contentstackMridul merged commit 9cbb317 into 18th-sept-2025-release Sep 16, 2025
9 checks passed
@contentstackMridul contentstackMridul deleted the live-preview-new-tab-ssr-issue branch September 16, 2025 10:58
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.

3 participants