Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/command/Commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ define(function (require, exports, module) {
/** Opens the terminal panel */
exports.VIEW_TERMINAL = "view.terminal"; // Terminal/main.js _showTerminal()

/** Toggles whether AI features are enabled */
exports.VIEW_ENABLE_AI = "view.enableAI"; // phoenix-pro aiEnabled.js _handleToggleEnableAI()

/** Toggles line numbers visibility */
exports.TOGGLE_LINE_NUMBERS = "view.toggleLineNumbers"; // EditorOptionHandlers.js _getToggler()

Expand Down
20 changes: 20 additions & 0 deletions src/extensionsIntegrated/Phoenix/phoenix-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ define(function (require, exports, module) {
CommandManager = require("command/CommandManager"),
Commands = require("command/Commands"),
WorkspaceManager = require("view/WorkspaceManager"),
PreferencesManager = require("preferences/PreferencesManager"),
CentralControlBar = require("view/CentralControlBar");

const TOUR_STORAGE_KEY = "phoenixOnboardingTourState";
Expand Down Expand Up @@ -89,6 +90,17 @@ define(function (require, exports, module) {
const STEP2_PEEK_HOLD_MS = 2000;
const SIDEBAR_AI_TAB_ID = "ai";

/**
* True when the user has deliberately turned AI off (see the `enableAI`
* preference owned by phoenix-pro). The tab is legitimately absent in that
* case, so step 2 skips itself instead of reporting a missing-tab error.
* The pref is undefined in builds without phoenix-pro, hence the explicit
* `=== false` check rather than a falsy test.
*/
function _isAIDisabledByUser() {
return PreferencesManager.get("enableAI") === false;
}

function _markComplete() {
_state.version = CURRENT_TOUR_VERSION;
_saveState(_state);
Expand Down Expand Up @@ -391,6 +403,14 @@ define(function (require, exports, module) {
_detachStepClickMetric();
_cancelStep2AIPeek();
_ensureSidebarVisible();
if (_isAIDisabledByUser()) {
// The user turned AI off — there is nothing to introduce, so skip the
// whole step rather than half of it. Checked before the tab lookup so
// this also covers the window between disabling AI and the restart
// that actually removes the tab, where the tab is still in the DOM.
_runStep3();
return;
}
const $tab = $('.sidebar-tab[data-tab-id="ai"]');
if (!$tab.length) {
logger.reportError(new Error("phoenix-tour: AI sidebar tab missing at step 2"));
Expand Down
10 changes: 10 additions & 0 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,7 @@ define({
"CMD_VIEW_TOGGLE_INSPECTION": "Lint Files on Save",
"CMD_VIEW_TOGGLE_PROBLEMS": "Problems",
"CMD_VIEW_TERMINAL": "Terminal",
"CMD_VIEW_ENABLE_AI": "Enable AI",
"CMD_WORKINGSET_SORT_BY_ADDED": "Sort by Added",
"CMD_WORKINGSET_SORT_BY_NAME": "Sort by Name",
"CMD_WORKINGSET_SORT_BY_TYPE": "Sort by Type",
Expand Down Expand Up @@ -2020,6 +2021,7 @@ define({
"DESCRIPTION_INDENT_GUIDES_ENABLED": "true to show indent guide lines, else false.",
"DESCRIPTION_HIDE_FIRST": "true to show the first Indent Guide line else false.",
"DESCRIPTION_CSS_COLOR_PREVIEW": "true to display color previews in the gutter, else false.",
"DESCRIPTION_ENABLE_AI": "true to enable AI features, false to disable AI entirely.",

// Emmet
"DESCRIPTION_EMMET": "true to enable Emmet, else false.",
Expand Down Expand Up @@ -2490,6 +2492,14 @@ define({
"AI_UPSELL_DIALOG_TITLE": "Continue with {0}?",
"AI_UPSELL_DIALOG_MESSAGE": "You’ve discovered {0}. To proceed, you’ll need an AI subscription or credits.",

// Enable/disable AI toggle
"AI_DISABLE_CONFIRM_TITLE": "Disable AI?",
"AI_DISABLE_CONFIRM_MESSAGE": "This turns off all AI features. The AI panel will be removed and {APP_NAME} will stop connecting to AI services.<br><br>Restart {APP_NAME} for this to take effect.",
"AI_DISABLE_CONFIRM_BTN": "Disable AI",
"AI_ENABLE_CONFIRM_TITLE": "Enable AI?",
"AI_ENABLE_CONFIRM_MESSAGE": "This turns AI features back on and restores the AI panel.<br><br>Restart {APP_NAME} for this to take effect.",
"AI_ENABLE_CONFIRM_BTN": "Enable AI",

// AI CHAT PANEL
"AI_CHAT_TITLE": "Claude Code",
"AI_CHAT_SURPRISE_ME_USER_MSG": "Surprise me!",
Expand Down
2 changes: 1 addition & 1 deletion tracking-repos.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"phoenixPro": {
"commitID": "844cfa15093ec806a3b3327bb36791ca41405a66"
"commitID": "d91453669c6c158c5495c2c3a804fed0ad7f7be3"
}
}
Loading