diff --git a/.gitignore b/.gitignore index 53be4d0d9c..e7cd8fdf27 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ Thumbs.db /phoenix-builder-mcp/chrome_extension/build/ /phoenix-builder-mcp/chrome_extension/*.zip +# claude +.claude/**/*.lock + # ignore node_modules inside src /src/node_modules /src-node/node_modules diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 03ad037734..b7c2636446 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -62,6 +62,7 @@ define(function (require, exports, module) { NodeUtils = require("utils/NodeUtils"), ChangeHelper = require("editor/EditorHelper/ChangeHelper"), SidebarTabs = require("view/SidebarTabs"), + SidebarView = require("project/SidebarView"), _ = require("thirdparty/lodash"); const KernalModeTrust = window.KernalModeTrust; @@ -1954,7 +1955,7 @@ define(function (require, exports, module) { function handleShowInTree() { let activeFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE); if(activeFile){ - if (!$("#sidebar").is(":visible")) { + if (!SidebarView.isVisible()) { CommandManager.execute(Commands.VIEW_HIDE_SIDEBAR); } SidebarTabs.setActiveTab(SidebarTabs.SIDEBAR_TAB_FILES); diff --git a/src/extensionsIntegrated/CollapseFolders/main.js b/src/extensionsIntegrated/CollapseFolders/main.js index 541d79537c..f01ef52994 100644 --- a/src/extensionsIntegrated/CollapseFolders/main.js +++ b/src/extensionsIntegrated/CollapseFolders/main.js @@ -18,21 +18,14 @@ * */ -/* Displays sidebar-hover action buttons: "show in file tree" (binoculars) and - * "collapse all folders" (stacked chevrons). Both appear on sidebar hover so the - * sidebar stays visually quiet when the user isn't interacting with it. */ -/* Styling for both buttons is done in `../../styles/Extn-CollapseFolders.less` */ +/* Displays a Collapse button in the sidebar area */ +/* when the button gets clicked, it closes all the directories recursively that are opened */ +/* Styling for the button is done in `../../styles/Extn-CollapseFolders.less` */ define(function (require, exports, module) { const AppInit = require("utils/AppInit"); - const CommandManager = require("command/CommandManager"); - const Commands = require("command/Commands"); const ProjectManager = require("project/ProjectManager"); const Strings = require("strings"); - const SHOW_IN_TREE_SVG = ''; - /** * This is the main function that handles the closing of all the directories */ @@ -59,37 +52,30 @@ define(function (require, exports, module) { } } - function _handleShowInTreeClick() { - CommandManager.execute(Commands.NAVIGATE_SHOW_IN_FILE_TREE); - } - /** - * Append the sidebar hover actions: a "Show in File Tree" binoculars button - * followed by the "Collapse All" chevron button. Both live in - * #project-files-header and become visible only on #sidebar:hover. + * This function is responsible to create the 'Collapse All' button + * and append it to the sidebar area on the project-files-header */ - function createSidebarHoverButtons() { + function createCollapseButton() { const $projectFilesHeader = $("#project-files-header"); + // make sure that we were able to get the project-files-header DOM element if ($projectFilesHeader.length === 0) { return; } - const $showInTreeBtn = $('
' + SHOW_IN_TREE_SVG + '
'); - $showInTreeBtn.on("click", _handleShowInTreeClick); - $projectFilesHeader.append($showInTreeBtn); - + // create the collapse btn const $collapseBtn = $(`
`); + $collapseBtn.on("click", handleCollapseBtnClick); - $projectFilesHeader.append($collapseBtn); + $projectFilesHeader.append($collapseBtn); // append the btn to the project-files-header } AppInit.appReady(function () { - createSidebarHoverButtons(); + createCollapseButton(); }); }); diff --git a/src/index.html b/src/index.html index d196537d80..5ba5083941 100644 --- a/src/index.html +++ b/src/index.html @@ -905,7 +905,7 @@
-