Skip to content

Commit 111eacc

Browse files
committed
fix: deprecated extensions dialog wont come up again and styling tweaks
1 parent 77d3de1 commit 111eacc

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

src/htmlContent/deprecated-extensions-dialog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1 class="dialog-title">{{Strings.DEPRECATED_EXTENSIONS_TITLE}}</h1>
77

88
<div class="deprecated-extensions-list" style="margin-top: 16px;">
99
{{#extensions}}
10-
<div class="deprecated-extension-item" style="margin-bottom: 12px; padding: 12px; border: 1px solid var(--border-color, #ddd); border-radius: 4px;">
10+
<div class="deprecated-extension-item" style="margin-bottom: 12px; padding: 12px;">
1111
<div class="extension-info" style="margin-bottom: 6px;">
1212
<i class="fa fa-exclamation-triangle" style="color: #f5a623; margin-right: 8px;"></i>
1313
<strong>{{id}}</strong>

src/nls/root/strings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,8 +1725,8 @@ define({
17251725
"LICENSE_REAPPLY_TO_DEVICE": "Already activated? Reapply system-wide",
17261726
// Deprecated Extensions Dialog
17271727
"DEPRECATED_EXTENSIONS_TITLE": "Deprecated Extensions Detected",
1728-
"DEPRECATED_EXTENSIONS_MESSAGE": "The following installed extensions are now natively supported by Phoenix and can be safely removed:",
1729-
"DEPRECATED_EXTENSIONS_LEARN_MORE": "Learn more about the native feature",
1728+
"DEPRECATED_EXTENSIONS_MESSAGE": "The following installed extensions are now natively supported by {APP_NAME} and can be safely uninstalled from the Extension Manager:",
1729+
"DEPRECATED_EXTENSIONS_LEARN_MORE": "Now built-in — learn more",
17301730
// AI CONTROL
17311731
"AI_LOGIN_DIALOG_TITLE": "Sign In to Use AI Edits",
17321732
"AI_LOGIN_DIALOG_MESSAGE": "Please log in to use AI-powered edits",

src/utils/ExtensionLoader.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,16 +1043,10 @@ define(function (require, exports, module) {
10431043
}
10441044

10451045
/**
1046-
* Check if any deprecated extensions are installed and show a dialog once
1046+
* Check if any deprecated extensions are installed and show a dialog once per extension
10471047
* @private
10481048
*/
10491049
function _checkAndShowDeprecatedExtensionsDialog() {
1050-
// Check if we've already shown the dialog
1051-
const dialogShown = PreferencesManager.stateManager.get(STATE_DEPRECATED_EXTENSIONS_DIALOG_SHOWN);
1052-
if (dialogShown) {
1053-
return;
1054-
}
1055-
10561050
// Get deprecated extensions config
10571051
const deprecatedExtensionsConfig = DefaultExtensions.deprecatedExtensions;
10581052
if (!deprecatedExtensionsConfig || !deprecatedExtensionsConfig.extensionIDsAndDocs) {
@@ -1061,20 +1055,25 @@ define(function (require, exports, module) {
10611055

10621056
const deprecatedExtensionIDs = deprecatedExtensionsConfig.extensionIDsAndDocs;
10631057

1064-
// Check which deprecated extensions are loaded
1058+
// Get the state object that tracks which deprecated extensions we've already shown
1059+
let shownDeprecatedExtensions = PreferencesManager.stateManager.get(STATE_DEPRECATED_EXTENSIONS_DIALOG_SHOWN);
1060+
if (!shownDeprecatedExtensions || typeof shownDeprecatedExtensions !== 'object') {
1061+
shownDeprecatedExtensions = {};
1062+
}
1063+
1064+
// Check which deprecated extensions are loaded and not yet shown
10651065
const deprecatedExtensionsFound = [];
10661066
for (const extensionID of loadedExtensionIDs) {
1067-
if (deprecatedExtensionIDs[extensionID]) {
1067+
if (deprecatedExtensionIDs[extensionID] && !shownDeprecatedExtensions[extensionID]) {
10681068
deprecatedExtensionsFound.push({
10691069
id: extensionID,
10701070
docUrl: deprecatedExtensionIDs[extensionID]
10711071
});
10721072
}
10731073
}
10741074

1075-
// If no deprecated extensions found, mark dialog as shown and return
1075+
// If no new deprecated extensions found, return
10761076
if (deprecatedExtensionsFound.length === 0) {
1077-
PreferencesManager.stateManager.set(STATE_DEPRECATED_EXTENSIONS_DIALOG_SHOWN, true);
10781077
return;
10791078
}
10801079

@@ -1087,8 +1086,11 @@ define(function (require, exports, module) {
10871086
const $template = $(Mustache.render(DeprecatedExtensionsTemplate, templateVars));
10881087
Dialogs.showModalDialogUsingTemplate($template);
10891088

1090-
// Mark dialog as shown
1091-
PreferencesManager.stateManager.set(STATE_DEPRECATED_EXTENSIONS_DIALOG_SHOWN, true);
1089+
// Mark each extension as shown
1090+
for (const ext of deprecatedExtensionsFound) {
1091+
shownDeprecatedExtensions[ext.id] = true;
1092+
}
1093+
PreferencesManager.stateManager.set(STATE_DEPRECATED_EXTENSIONS_DIALOG_SHOWN, shownDeprecatedExtensions);
10921094
}
10931095

10941096

0 commit comments

Comments
 (0)