Skip to content

Commit 7a57d7a

Browse files
authored
[MDiff] Add welcome experience and site-level discard functionality (#1412)
- Add welcome tree items with CTA for first-time users of site comparison - Implement DiscardSiteChangesHandler to discard all local changes at site level - Replace generic icons with custom download/upload SVGs for export/import - Update report labels: "Site Comparison Report", "Added/Deleted Locally" - Reorganize inline menu buttons for better UX - Refactor MultiStepInput utility for improved maintainability - Add comprehensive tests for new features
1 parent c9da940 commit 7a57d7a

34 files changed

+2499
-437
lines changed

l10n/bundle.l10n.json

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,18 @@
359359
"No differences found between the remote site and your local workspace.": "No differences found between the remote site and your local workspace.",
360360
"Comparing files...": "Comparing files...",
361361
"Site Comparison": "Site Comparison",
362+
"Find differences between your remote site and local workspace": "Find differences between your remote site and local workspace",
363+
"Click to compare your local site with an environment": "Click to compare your local site with an environment",
364+
"Use File → Open Folder to select a folder with a Power Pages site": "Use File → Open Folder to select a folder with a Power Pages site",
365+
"Compare site...": "Compare site...",
362366
"Modified": "Modified",
363367
"Added locally": "Added locally",
364368
"Deleted locally": "Deleted locally",
365369
"Download is complete. You can now view the report.": "Download is complete. You can now view the report.",
366370
"Select an environment to compare with": "Select an environment to compare with",
367371
"Select a website to compare with": "Select a website to compare with",
372+
"Compare site with environment": "Compare site with environment",
373+
"Loading...": "Loading...",
368374
"No sites found in the selected environment.": "No sites found in the selected environment.",
369375
"Matching Site": "Matching Site",
370376
"Enhanced Data Model": "Enhanced Data Model",
@@ -385,12 +391,13 @@
385391
"Save Report": "Save Report",
386392
"Save HTML Report": "Save HTML Report",
387393
"Open Report": "Open Report",
388-
"Metadata Diff Report": "Metadata Diff Report",
389-
"Power Pages Site Comparison Results": "Power Pages Site Comparison Results",
394+
"Site Comparison Report": "Site Comparison Report",
395+
"Power Platform Tools - Site Comparison": "Power Platform Tools - Site Comparison",
390396
"Total Changes": "Total Changes",
391-
"Added": "Added",
392-
"Deleted": "Deleted",
397+
"Added Locally": "Added Locally",
398+
"Deleted Locally": "Deleted Locally",
393399
"Comparison Details": "Comparison Details",
400+
"Remote": "Remote",
394401
"Site Name:": "Site Name:",
395402
"Environment:": "Environment:",
396403
"Website ID:": "Website ID:",
@@ -400,6 +407,7 @@
400407
"Creator:": "Creator:",
401408
"Created On:": "Created On:",
402409
"Generated:": "Generated:",
410+
"Total Files:": "Total Files:",
403411
"Changed Files": "Changed Files",
404412
"(click to expand diff)": "(click to expand diff)",
405413
"Expand All": "Expand All",
@@ -408,8 +416,6 @@
408416
"No files in this category": "No files in this category",
409417
"Generated by": "Generated by",
410418
"Power Platform Tools VS Code Extension": "Power Platform Tools VS Code Extension",
411-
"Added Locally": "Added Locally",
412-
"Deleted Locally": "Deleted Locally",
413419
"Unknown": "Unknown",
414420
"Binary file - content comparison not available": "Binary file - content comparison not available",
415421
"Unable to read file contents": "Unable to read file contents",
@@ -494,6 +500,18 @@
494500
"Success message after discarding all local changes in a folder."
495501
]
496502
},
503+
"Are you sure you want to discard all {0} local changes in '{1}'?\n\nLocal path: {2}\n\nThis action cannot be undone./Confirmation message before discarding all local changes in a site.": {
504+
"message": "Are you sure you want to discard all {0} local changes in '{1}'?\n\nLocal path: {2}\n\nThis action cannot be undone.",
505+
"comment": [
506+
"Confirmation message before discarding all local changes in a site."
507+
]
508+
},
509+
"Successfully discarded all {0} local changes in '{1}'./Success message after discarding all local changes in a site.": {
510+
"message": "Successfully discarded all {0} local changes in '{1}'.",
511+
"comment": [
512+
"Success message after discarding all local changes in a site."
513+
]
514+
},
497515
"Compare: {0} (Remote ↔ Local)/Title for the multi-diff editor when comparing all files in a site.": {
498516
"message": "Compare: {0} (Remote ↔ Local)",
499517
"comment": [

loc/translations-export/vscode-powerplatform.xlf

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
<trans-unit id="++CODE++b544cb198e99ff113ac41467fc99191f11916287ccdb1ae619dba61dd6bbeff6">
5353
<source xml:lang="en">Add content snippet name (name should be unique)</source>
5454
</trans-unit>
55-
<trans-unit id="++CODE++6b02e0d363a4af1c95eef50364bb0202c8b250aa05a48a69e68fd7787b4b0632">
56-
<source xml:lang="en">Added</source>
57-
</trans-unit>
5855
<trans-unit id="++CODE++15593a5b5afa7d2fd80e213e5035a35bb260e4cb5c1b18bca70583b796f11a5c">
5956
<source xml:lang="en">Added Locally</source>
6057
</trans-unit>
@@ -90,6 +87,14 @@
9087
<source xml:lang="en">Are you sure you want to delete the Auth Profile {0}-{1}?</source>
9188
<note>{0} is the user name, {1} is the URL of environment of the auth profile</note>
9289
</trans-unit>
90+
<trans-unit id="++CODE++dac1196b143f32a5c733daa9a35421763d3d78be99ff690819989762a3611da6">
91+
<source xml:lang="en">Are you sure you want to discard all {0} local changes in '{1}'?
92+
93+
Local path: {2}
94+
95+
This action cannot be undone.</source>
96+
<note>Confirmation message before discarding all local changes in a site.</note>
97+
</trans-unit>
9398
<trans-unit id="++CODE++1d9cd153bf20c28e77061a9743a69cc8850f21221a1871f1c13b27e8470a2688">
9499
<source xml:lang="en">Are you sure you want to discard local changes to '{0}'? This action cannot be undone.</source>
95100
<note>Confirmation message before discarding local changes to a file.</note>
@@ -199,6 +204,9 @@ The second line should be '[TRANSLATION HERE](https://aka.ms/pages-clear-cache).
199204
<trans-unit id="++CODE++b1ffea87cc95d3bfa308b929bb907b43e7d91be038e706a67142b15c571da334">
200205
<source xml:lang="en">Click to authenticate with a matching account</source>
201206
</trans-unit>
207+
<trans-unit id="++CODE++ee9d4bb8e9f94832366fe390fde5efc4b555d1464ef6023d3c0b25de58223bcc">
208+
<source xml:lang="en">Click to compare your local site with an environment</source>
209+
</trans-unit>
202210
<trans-unit id="++CODE++7d9eb7acb13e24625c404401d8e88b2350e32162455885f18276cf802f7701ed">
203211
<source xml:lang="en">Close</source>
204212
</trans-unit>
@@ -277,6 +285,12 @@ Check the CodeQL extension panel for available queries.</source>
277285
<trans-unit id="++CODE++67a58f1682f864bfa789f056e50bab25181dfcddf455fadaad856c826f852d6a">
278286
<source xml:lang="en">Command failed with exit code: {0}</source>
279287
</trans-unit>
288+
<trans-unit id="++CODE++d73890ab56fd9e1ff5349b7bdb41fe0d848c5960c096b30357e26b912456f21f">
289+
<source xml:lang="en">Compare site with environment</source>
290+
</trans-unit>
291+
<trans-unit id="++CODE++3c69bfaf47b25fe112854a5ba01f4d882248d17e6e76c7d1b0a9da8dc3a7929a">
292+
<source xml:lang="en">Compare site...</source>
293+
</trans-unit>
280294
<trans-unit id="++CODE++95de5784f48c7fee97755bb29a90a128546a6a30201be3c73493229230ea7f72">
281295
<source xml:lang="en">Compare: {0} (Remote ↔ Local)</source>
282296
<note>Title for the multi-diff editor when comparing all files in a site.</note>
@@ -384,9 +398,6 @@ Check the CodeQL extension panel for available queries.</source>
384398
<source xml:lang="en">Default Environment: {0}</source>
385399
<note>The {0} represents profile's resource/environment URL</note>
386400
</trans-unit>
387-
<trans-unit id="++CODE++b48ff39c2e0f5451b9b29b09c2a74d2760db230749ffd48a6e901cc91fef9a8d">
388-
<source xml:lang="en">Deleted</source>
389-
</trans-unit>
390401
<trans-unit id="++CODE++bb1de92420a69402b065edb03f642d93984ea080582fb8b1ff49fee3aab7cab1">
391402
<source xml:lang="en">Deleted Locally</source>
392403
</trans-unit>
@@ -602,6 +613,9 @@ The {3} represents Solution's Type (Managed or Unmanaged), but that test is loca
602613
<trans-unit id="++CODE++12610d51818dd67082559a8f1d9a141559d996fad6fe34aa3dbf70281bea4572">
603614
<source xml:lang="en">File: {0}</source>
604615
</trans-unit>
616+
<trans-unit id="++CODE++cc2cc5f1256a46b0f5c8fc579d2513fdd4a8ae48d288334b5682d88fba9702da">
617+
<source xml:lang="en">Find differences between your remote site and local workspace</source>
618+
</trans-unit>
605619
<trans-unit id="++CODE++4c152c6eaba506f1e585f1fe8424b694874ccf652f4bdebb5e333ed518e9e428">
606620
<source xml:lang="en">Found CodeQL CLI at: {0}</source>
607621
</trans-unit>
@@ -726,6 +740,9 @@ Return to this chat and @powerpages can help you write and edit your website cod
726740
<trans-unit id="++CODE++47dc2e01d9ad434bd03a870bdfd91281bc31d38da2cdc36c0d46a593b1d6d60c">
727741
<source xml:lang="en">Line: {0}</source>
728742
</trans-unit>
743+
<trans-unit id="++CODE++47d2a515ef2f05b87d688656286a61e4f743da4b878684c7654969db17711c40">
744+
<source xml:lang="en">Loading...</source>
745+
</trans-unit>
729746
<trans-unit id="++CODE++8c31e6e7223097e2e4847773c47a4efab6aaf79deeecc92a7759891c74976dde">
730747
<source xml:lang="en">Local</source>
731748
</trans-unit>
@@ -760,9 +777,6 @@ Return to this chat and @powerpages can help you write and edit your website cod
760777
<trans-unit id="++CODE++d39a5fa0fca9df105f95b7dfa9a2705ccddaead33bd3119052baabe6c923a85d">
761778
<source xml:lang="en">Metadata Diff JSON</source>
762779
</trans-unit>
763-
<trans-unit id="++CODE++7accb685e6522ef72613a3d16ae7f3ce6ee978ac591c512054ec9e6bc2efef00">
764-
<source xml:lang="en">Metadata Diff Report</source>
765-
</trans-unit>
766780
<trans-unit id="++CODE++b1c8258fb401975727a82d9ce473af0a600f076cc7b73dbd16524e815cf4153d">
767781
<source xml:lang="en">Microsoft wants your feedback</source>
768782
</trans-unit>
@@ -965,15 +979,15 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
965979
<trans-unit id="++CODE++f519c6aeba20c1a712f6043bf6eb52bf3bb8834f5f1a6c9ea60244dbbb30453c">
966980
<source xml:lang="en">Power Pages Server Logic detected! You can now debug your server logic files with breakpoints and IntelliSense.</source>
967981
</trans-unit>
968-
<trans-unit id="++CODE++db40be71cd139d96719d08f10c843b8bf1c2a0d3d2da06902109a758a98bc9f9">
969-
<source xml:lang="en">Power Pages Site Comparison Results</source>
970-
</trans-unit>
971982
<trans-unit id="++CODE++04ac907168ac84b45263503d1306565bece49c4ae3e8ef4af310b304f03ab6d4">
972983
<source xml:lang="en">Power Pages site download completed successfully. Would you like to open the downloaded site folder?</source>
973984
</trans-unit>
974985
<trans-unit id="++CODE++cce89cd3a0f118dafd3173f6444abdcd2b9782153af1b6bfa8f63ef3d4b68268">
975986
<source xml:lang="en">Power Pages studio URL is not available</source>
976987
</trans-unit>
988+
<trans-unit id="++CODE++41024d68d0b449f0dfc48541fe0be218aa6acc1cc982ef1a701b759f037fecfa">
989+
<source xml:lang="en">Power Platform Tools - Site Comparison</source>
990+
</trans-unit>
977991
<trans-unit id="++CODE++8ce54044bb9e895666fd98c1b6e497655a4c2a7239b2187599972e9d81bd0f3e">
978992
<source xml:lang="en">Power Platform Tools VS Code Extension</source>
979993
</trans-unit>
@@ -1016,6 +1030,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
10161030
<source xml:lang="en">Refreshing comparison for {0} ([details](command:microsoft.powerplatform.pages.actionsHub.showOutputChannel &quot;Show download output&quot;))...</source>
10171031
<note>This is a markdown formatting which must persist across translations.</note>
10181032
</trans-unit>
1033+
<trans-unit id="++CODE++ffa98e02f7ce33fc935f02b3b668f6ad57661814dade5f41453fbee2b70cdd95">
1034+
<source xml:lang="en">Remote</source>
1035+
</trans-unit>
10191036
<trans-unit id="++CODE++95e154398a4bc0091aa4d6b607472ac5a89e41fbc84a3a49f823314d6de9eebc">
10201037
<source xml:lang="en">Replace</source>
10211038
</trans-unit>
@@ -1114,6 +1131,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
11141131
<trans-unit id="++CODE++413f481712d78c8cce54fc6b1ef2da1b4e35e9584c11fcdc51509c19017e2812">
11151132
<source xml:lang="en">Site Comparison</source>
11161133
</trans-unit>
1134+
<trans-unit id="++CODE++87fa4c14343dbe871004d198588448a3b43c12dae48f8b1cb63d53e8e2687a29">
1135+
<source xml:lang="en">Site Comparison Report</source>
1136+
</trans-unit>
11171137
<trans-unit id="++CODE++524bca0347e50e3801bebf27374124b3babf072729b4da4bcc45ef5c385ee8f4">
11181138
<source xml:lang="en">Site Details</source>
11191139
</trans-unit>
@@ -1160,6 +1180,10 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
11601180
<trans-unit id="++CODE++155f816c0407310c0dab222493370773e045ee7fe04e6c9a951b07f495531264">
11611181
<source xml:lang="en">Submit</source>
11621182
</trans-unit>
1183+
<trans-unit id="++CODE++4bcd6903494ba202e376e60698d4f937a3515af0fb4bdcad4875e4f76736b0dd">
1184+
<source xml:lang="en">Successfully discarded all {0} local changes in '{1}'.</source>
1185+
<note>Success message after discarding all local changes in a site.</note>
1186+
</trans-unit>
11631187
<trans-unit id="++CODE++9543efee4b5aadd6f27f5d4a06361b18d153aaf0b66e0121622fb9fd3581fdf8">
11641188
<source xml:lang="en">Successfully discarded local changes to '{0}'.</source>
11651189
<note>Success message after discarding local changes to a file.</note>
@@ -1246,6 +1270,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
12461270
<trans-unit id="++CODE++9ffd094afb84d3a84bbf1b4ec8210ba5344169e9b2726ce366ccf3e231b7e9b7">
12471271
<source xml:lang="en">Total Changes</source>
12481272
</trans-unit>
1273+
<trans-unit id="++CODE++1ad14134a4f26b4cf2f8e203eb324fab77722a2f5368f489162d3d2319d01060">
1274+
<source xml:lang="en">Total Files:</source>
1275+
</trans-unit>
12491276
<trans-unit id="++CODE++4a7c431a6572c68bba17c3a5d858adbf5112462574953baf4d7d2fd0619807fe">
12501277
<source xml:lang="en">Try @powerpages with GitHub Copilot</source>
12511278
</trans-unit>
@@ -1304,6 +1331,9 @@ The {3} represents Dataverse Environment's Organization ID (GUID)</note>
13041331
<trans-unit id="++CODE++8a91e7caf57148c6be78b3986477464b36f0282a9e9a09b635b0db4fe6246132">
13051332
<source xml:lang="en">Upload failed. Please try again later.</source>
13061333
</trans-unit>
1334+
<trans-unit id="++CODE++037bfba715811960dfb62b81a99d5002835f73a9c44bdd6661ebc222d8538e2b">
1335+
<source xml:lang="en">Use File → Open Folder to select a folder with a Power Pages site</source>
1336+
</trans-unit>
13071337
<trans-unit id="++CODE++c86daff3d88f7b1f615467872994ef13dcbc1c55e10105d71f398c721650c9c2">
13081338
<source xml:lang="en">Use current site folder</source>
13091339
</trans-unit>
@@ -1523,6 +1553,9 @@ The fifth line should be '[TRANSLATION HERE](command:powerplatform-walkthrough.s
15231553
<trans-unit id="pacCLI.disableTelemetry.title">
15241554
<source xml:lang="en">Disable PAC Telemetry</source>
15251555
</trans-unit>
1556+
<trans-unit id="microsoft.powerplatform.pages.actionsHub.metadataDiff.discardSite.title">
1557+
<source xml:lang="en">Discard All Local Changes</source>
1558+
</trans-unit>
15261559
<trans-unit id="microsoft.powerplatform.pages.actionsHub.metadataDiff.discardFolder.title">
15271560
<source xml:lang="en">Discard All Local Changes</source>
15281561
</trans-unit>

package.json

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,12 @@
563563
"icon": "$(discard)",
564564
"when": "microsoft.powerplatform.pages.metadataDiffEnabled"
565565
},
566+
{
567+
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.discardSite",
568+
"title": "%microsoft.powerplatform.pages.actionsHub.metadataDiff.discardSite.title%",
569+
"icon": "$(discard)",
570+
"when": "microsoft.powerplatform.pages.metadataDiffEnabled"
571+
},
566572
{
567573
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.sortByName",
568574
"title": "%microsoft.powerplatform.pages.actionsHub.metadataDiff.sortByName.title%",
@@ -596,13 +602,19 @@
596602
{
597603
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.export",
598604
"title": "%microsoft.powerplatform.pages.actionsHub.metadataDiff.export.title%",
599-
"icon": "$(export)",
605+
"icon": {
606+
"light": "src/client/assets/download-icon/light/download.svg",
607+
"dark": "src/client/assets/download-icon/dark/download.svg"
608+
},
600609
"when": "microsoft.powerplatform.pages.metadataDiffEnabled"
601610
},
602611
{
603612
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.import",
604613
"title": "%microsoft.powerplatform.pages.actionsHub.metadataDiff.import.title%",
605-
"icon": "$(cloud-download)",
614+
"icon": {
615+
"light": "src/client/assets/upload-icon/light/upload.svg",
616+
"dark": "src/client/assets/upload-icon/dark/upload.svg"
617+
},
606618
"when": "microsoft.powerplatform.pages.metadataDiffEnabled"
607619
},
608620
{
@@ -1213,6 +1225,10 @@
12131225
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.discardFolder",
12141226
"when": "never"
12151227
},
1228+
{
1229+
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.discardSite",
1230+
"when": "never"
1231+
},
12161232
{
12171233
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.sortByName",
12181234
"when": "never"
@@ -1423,25 +1439,20 @@
14231439
"when": "view == microsoft.powerplatform.pages.actionsHub && (viewItem == currentActiveSite || viewItem == nonCurrentActiveSite || viewItem == inactiveSite) &&microsoft.powerplatform.pages.metadataDiffEnabled",
14241440
"group": "siteAction@8"
14251441
},
1426-
{
1427-
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.openAll",
1428-
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSite && microsoft.powerplatform.pages.metadataDiffEnabled",
1429-
"group": "inline@1"
1430-
},
14311442
{
14321443
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.resync",
14331444
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSite && microsoft.powerplatform.pages.metadataDiffEnabled",
1434-
"group": "inline@2"
1445+
"group": "inline@1"
14351446
},
14361447
{
14371448
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.export",
14381449
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSite && microsoft.powerplatform.pages.metadataDiffEnabled",
1439-
"group": "inline@3"
1450+
"group": "inline@2"
14401451
},
14411452
{
14421453
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.removeSite",
14431454
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSite && microsoft.powerplatform.pages.metadataDiffEnabled",
1444-
"group": "inline@4"
1455+
"group": "inline@3"
14451456
},
14461457
{
14471458
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.openAll",
@@ -1464,24 +1475,24 @@
14641475
"group": "siteAction@4"
14651476
},
14661477
{
1467-
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.removeSite",
1478+
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.discardSite",
14681479
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSite && microsoft.powerplatform.pages.metadataDiffEnabled",
1469-
"group": "zRemoveAction@1"
1480+
"group": "siteAction@5"
14701481
},
14711482
{
1472-
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.openAll",
1473-
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSiteImported && microsoft.powerplatform.pages.metadataDiffEnabled",
1474-
"group": "inline@1"
1483+
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.removeSite",
1484+
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSite && microsoft.powerplatform.pages.metadataDiffEnabled",
1485+
"group": "zRemoveAction@1"
14751486
},
14761487
{
14771488
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.export",
14781489
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSiteImported && microsoft.powerplatform.pages.metadataDiffEnabled",
1479-
"group": "inline@2"
1490+
"group": "inline@1"
14801491
},
14811492
{
14821493
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.removeSite",
14831494
"when": "view == microsoft.powerplatform.pages.actionsHub && viewItem == metadataDiffSiteImported && microsoft.powerplatform.pages.metadataDiffEnabled",
1484-
"group": "inline@3"
1495+
"group": "inline@2"
14851496
},
14861497
{
14871498
"command": "microsoft.powerplatform.pages.actionsHub.metadataDiff.openAll",

0 commit comments

Comments
 (0)