Skip to content

Commit 52f024f

Browse files
committed
feat: only show the migration dialog on the ChromeOS webapp
phcode.dev now loads silently for everyone else. The dialog was going up on every boot of the legacy origin, and outside the ChromeOS webapp it was not earning that: the origin still works, and anyone who does open the new site has their data pulled across automatically, so there is no action the modal has to get out of the user. The gate sits in main.js next to the isTestWindow guard, where the decision about which half of the flow runs already lives. sunset-dialog.js is unchanged apart from its header, so widening the audience later is a one line revert. No test covers this. main.js has no exports and _initLegacyOrigin already short circuits in a test window, so the gate is unreachable from a spec without moving the predicate into constants.js, where the test would only restate the implementation.
1 parent ed29c1e commit 52f024f

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎src/extensionsIntegrated/MigrateAssist/main.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
* Entry point for the one time move off the legacy web origin onto web.phcode.dev.
2323
*
2424
* Which half runs depends purely on which origin this window is:
25-
* - on the origin being retired, announce the move once per boot (sunset-dialog);
25+
* - on the origin being retired, announce the move once per boot (sunset-dialog), currently only
26+
* on the ChromeOS webapp;
2627
* - on the new origin, quietly check whether anything is left behind and pull it across
2728
* (migrator), plus register the Help menu entry that lets the user ask for it again later.
2829
*
@@ -45,7 +46,10 @@ define(function (require, exports, module) {
4546
Migrator = require("./migrator");
4647

4748
function _initLegacyOrigin() {
48-
if (Phoenix.isTestWindow) {
49+
// For now the announcement only goes up on the ChromeOS webapp. Everywhere else the legacy
50+
// origin stays silent: it keeps working, and the data of anyone who does open the new site
51+
// is pulled across automatically, so there is nothing the dialog has to make them do.
52+
if (Phoenix.isTestWindow || !Phoenix.browser.isChromeOS) {
4953
return;
5054
}
5155
SunsetDialog.show();

‎src/extensionsIntegrated/MigrateAssist/sunset-dialog.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
*/
2020

2121
/**
22-
* The "we are moving" dialog, shown on the origin being retired on every boot.
22+
* The "we are moving" dialog, shown on every boot of the origin being retired. main.js decides who
23+
* gets it; for now that is the ChromeOS webapp only.
2324
*
2425
* It states that the move is happening, with no countdown and no cutoff date: the move is under way
2526
* now, and naming a date we might not hold to would be worse than naming none.
@@ -87,7 +88,7 @@ define(function (require, exports, module) {
8788
}
8889

8990
/**
90-
* Shows the dialog. Called once per boot on the legacy origin; dismissing it is per boot only,
91+
* Shows the dialog. Called once per boot by main.js; dismissing it is per boot only,
9192
* so the user is reminded again next time rather than being able to silence it permanently.
9293
*/
9394
function show() {

0 commit comments

Comments
 (0)