@@ -414,6 +414,10 @@ function stringFileRef(value: unknown): string | undefined {
414414 return undefined
415415}
416416
417+ export function visualCompareWordPressUrl ( server : PlaygroundCliServer ) : string {
418+ return server . wordpressUrl ?? server . serverUrl
419+ }
420+
417421export async function runVisualCompareCommand ( {
418422 artifactRoot,
419423 runtimeSpec,
@@ -496,7 +500,7 @@ async function runVisualComparePairCommand({
496500 const candidatePath = artifactSession . absolutePath ( "candidate.png" )
497501 const diffPath = artifactSession . absolutePath ( "diff.png" )
498502 const startedAt = now ( )
499- const preview = browserPreviewRouting ( args , runtimeSpec , server . serverUrl )
503+ const preview = browserPreviewRouting ( args , runtimeSpec , visualCompareWordPressUrl ( server ) )
500504 const sourceTargetUrl = sourceUrl ? resolveBrowserPreviewUrl ( sourceUrl , preview . effectiveOrigin ) : undefined
501505 const candidateTargetUrl = candidateUrl ? resolveBrowserPreviewUrl ( candidateUrl , preview . effectiveOrigin ) : undefined
502506 let finalSourceUrl = sourceTargetUrl
@@ -844,7 +848,7 @@ function visualCompareMatrixArtifact(
844848 artifactType : "visual-compare" ,
845849 requestedUrl : expectedEntries . map ( ( entry ) => entry . name ) . join ( "," ) ,
846850 url : firstArtifact ?. url ?? "visual-compare-matrix" ,
847- preview : firstArtifact ?. preview ?? browserPreviewRouting ( args , runtimeSpec , server . serverUrl ) ,
851+ preview : firstArtifact ?. preview ?? browserPreviewRouting ( args , runtimeSpec , visualCompareWordPressUrl ( server ) ) ,
848852 files : {
849853 summary : matrixSummary . files . summary ,
850854 ...( matrixSummary . files . blocksEngineVisualParity ? { blocksEngineVisualParity : matrixSummary . files . blocksEngineVisualParity } : { } ) ,
@@ -1170,7 +1174,7 @@ async function writeVisualCompareMatrixSummary(
11701174 blocksEngineVisualParity : "files/browser/visual-compare/blocks-engine-visual-parity-report.json" ,
11711175 } ,
11721176 ...( ! matrixComplete ? {
1173- preview : entries [ 0 ] ?. artifact . preview ?? browserPreviewRouting ( args , runtimeSpec , server . serverUrl ) ,
1177+ preview : entries [ 0 ] ?. artifact . preview ?? browserPreviewRouting ( args , runtimeSpec , visualCompareWordPressUrl ( server ) ) ,
11741178 limitations : [ "visual compare matrix was interrupted or an expected input was missing before all comparisons completed; recovered comparisons contain complete per-entry evidence for finished viewports and structured diagnostics for incomplete entries" ] ,
11751179 } : { } ) ,
11761180 }
0 commit comments