From 3c2be5d56fb224d3743ca9811ac829e653a09a4f Mon Sep 17 00:00:00 2001 From: abose Date: Thu, 23 Oct 2025 11:35:34 +0530 Subject: [PATCH 1/2] chore: show privacy notice early so it doesnt overlap with pro upgrade dialog after 10 secs --- .../HealthData/HealthDataNotification.js | 57 +++---------------- src/services/promotions.js | 7 +-- 2 files changed, 12 insertions(+), 52 deletions(-) diff --git a/src/extensions/default/HealthData/HealthDataNotification.js b/src/extensions/default/HealthData/HealthDataNotification.js index b249180f68..95f8fe830f 100644 --- a/src/extensions/default/HealthData/HealthDataNotification.js +++ b/src/extensions/default/HealthData/HealthDataNotification.js @@ -1,65 +1,26 @@ -/* - * Copyright (c) 2021 - present core.ai . All rights reserved. - * Original work Copyright (c) 2015 - 2021 Adobe Systems Incorporated. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ +// SPDX-License-Identifier: AGPL-3.0-only +// Copyright (c) 2021 - present core.ai. All rights reserved. -/*global Phoenix*/ +/*global*/ define(function (require, exports, module) { - var PreferencesManager = brackets.getModule("preferences/PreferencesManager"), - ExtensionInterface = brackets.getModule("utils/ExtensionInterface"), + const PreferencesManager = brackets.getModule("preferences/PreferencesManager"), HealthDataPreview = require("HealthDataPreview"), HealthDataPopup = require("HealthDataPopup"); - const NEW_PROJECT_EXTENSION_INTERFACE = "Extn.Phoenix.newProject", - // Since we don't have any user accounts or trackable ID to uniquely identify a user on first launch, - // we should be ok GDPR wise to delay showing the health data popup. But it was found later to be annoying - // and a workflow distraction. So we show the health data popup almost immediately so that the user can - // close all the popups in on go. - POPUP_FIRST_LAUNCH_SHOW_DELAY = 5000; + // Since we don't have any user accounts or trackable ID to uniquely identify a user on first launch, + // we should be ok GDPR wise to delay showing the health data popup. But it was found later to be annoying + // and a workflow distraction. So we show the health data popup almost immediately so that the user can + // close all the popups in on go. - let newProjectExtension; - ExtensionInterface.waitAndGetExtensionInterface(NEW_PROJECT_EXTENSION_INTERFACE) - .then(interfaceObj => { - newProjectExtension = interfaceObj; - interfaceObj.on(interfaceObj.EVENT_NEW_PROJECT_DIALOGUE_CLOSED, ()=>{ - setTimeout(_showFirstLaunchPopup, POPUP_FIRST_LAUNCH_SHOW_DELAY); - }); - }); + _showFirstLaunchPopup(); function handleHealthDataStatistics() { HealthDataPreview.previewHealthData(); } - let popupShownInThisSession = false; function _showFirstLaunchPopup() { - // call this only after newProjectExtn interface is available - // Check whether the notification dialog should be shown. It will be shown only one time. - if(popupShownInThisSession){ - return; - } - popupShownInThisSession = true; - newProjectExtension.off(newProjectExtension.EVENT_NEW_PROJECT_DIALOGUE_CLOSED, _showFirstLaunchPopup); if(!window.testEnvironment){ const alreadyShown = PreferencesManager.getViewState("healthDataNotificationShown"); const prefs = PreferencesManager.getExtensionPrefs("healthData"); diff --git a/src/services/promotions.js b/src/services/promotions.js index ff8de4c9ea..d6a49616a6 100644 --- a/src/services/promotions.js +++ b/src/services/promotions.js @@ -371,10 +371,9 @@ define(function (require, exports, module) { } function _isAnyDialogsVisible() { - const $modal = $(`.modal.instance`); - const $notifications = $(`.notification-ui-tooltip`); - return ($modal.length > 0 && $modal.is(':visible')) || - ($notifications.length > 0 && $notifications.is(':visible')); + const dialogsVisible = $(`.modal.instance`).is(':visible'); + const notificationsVisible = $(`.notification-ui-tooltip`).is(':visible'); + return dialogsVisible || notificationsVisible; } /** From 3bdc7da3ce5c60a9f089add0f74afdb6d95994dd Mon Sep 17 00:00:00 2001 From: abose Date: Thu, 23 Oct 2025 11:47:39 +0530 Subject: [PATCH 2/2] chore: pro upgrade immediately on start to not keep user waiting for best ux --- src/services/promotions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/promotions.js b/src/services/promotions.js index d6a49616a6..4286d2ce97 100644 --- a/src/services/promotions.js +++ b/src/services/promotions.js @@ -48,7 +48,7 @@ define(function (require, exports, module) { const EVENT_PRO_UPGRADE_ON_INSTALL = "pro_upgrade_on_install"; const PROMO_LOCAL_FILE = path.join(Phoenix.app.getApplicationSupportDirectory(), Phoenix.isTestWindow ? "entitlements_promo_test.json" : "entitlements_promo.json"); - const TRIAL_POLL_MS = 10 * 1000; // 10 seconds after start, we assign a free trial if possible + const TRIAL_POLL_MS = 1000; // We assign a free trial if possible as soon as user comes in for best UX. const FIRST_INSTALL_TRIAL_DAYS = 30; const SUBSEQUENT_TRIAL_DAYS = 7; const MS_PER_DAY = 24 * 60 * 60 * 1000;