From 9cdffdf39be6008ce28397291c0e848e656476c2 Mon Sep 17 00:00:00 2001 From: Nicolas Kruk Date: Mon, 8 Dec 2025 11:21:23 -0500 Subject: [PATCH 1/2] fix: simplify component preview URL generation in PreviewUtils --- src/shared/previewUtils.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/shared/previewUtils.ts b/src/shared/previewUtils.ts index ff28e262..09b4232f 100644 --- a/src/shared/previewUtils.ts +++ b/src/shared/previewUtils.ts @@ -229,9 +229,7 @@ export class PreviewUtils { componentName?: string, targetOrg?: string ): string[] { - let appPath = `lwr/application/e/devpreview/ai/${encodeURIComponent( - 'localdev%2Fpreview' - )}?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`; + let appPath = `lwr/application/e/devpreview/ai/localdev-preview?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`; if (componentName) { // TODO: support other namespaces appPath += `&specifier=c/${componentName}`; @@ -253,19 +251,15 @@ export class PreviewUtils { * @param ldpServerUrl The URL for the local dev server * @param ldpServerId Record ID for the identity token * @param componentName The name of the component to preview - * @param encodePath Whether to encode the path * @returns The full URL for the component preview */ public static generateComponentPreviewUrl( instanceUrl: string, ldpServerUrl: string, ldpServerId: string, - componentName?: string, - encodePath = false + componentName?: string ): string { - let url = `${instanceUrl}/lwr/application/e/devpreview/ai/${ - encodePath ? encodeURIComponent('localdev%2Fpreview') : 'localdev%2Fpreview' - }?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`; + let url = `${instanceUrl}/lwr/application/e/devpreview/ai/localdev-preview?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`; if (componentName) { // TODO: support other namespaces url += `&specifier=c/${componentName}`; From 45046dc7c967078eada33b3dd499ba1c9197ed62 Mon Sep 17 00:00:00 2001 From: Nicolas Kruk Date: Mon, 8 Dec 2025 11:46:51 -0500 Subject: [PATCH 2/2] fix: streamline component preview URL generation in LightningDevComponent --- src/commands/lightning/dev/component.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/commands/lightning/dev/component.ts b/src/commands/lightning/dev/component.ts index 1aca172e..87458464 100644 --- a/src/commands/lightning/dev/component.ts +++ b/src/commands/lightning/dev/component.ts @@ -167,13 +167,7 @@ export default class LightningDevComponent extends SfCommand