From fa455deb89dcf11e553a3e9c5ea36b9078224df2 Mon Sep 17 00:00:00 2001 From: abose Date: Wed, 22 Apr 2026 14:56:03 +0530 Subject: [PATCH 1/6] revert: move back/forward, show-in-tree, search buttons to mainNavBar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User feedback indicated the old position (top-right of the sidebar nav) was better than the relocated positions inside the central control bar and the sidebar project-files-header. Restore the four divs in #mainNavBarRight with their original sprite-icon classes, drop the CCB .ccb-group-nav block and the sidebar-hover #show-in-file-tree button, and prune the CSS overrides that were added to host the buttons in the CCB. NavigationProvider wiring is unchanged — it still attaches to these IDs. Tests: - Move #showInfileTree and #searchNav click-dispatch tests to the NavigationAndHistory integ suite. - Add a scroll-to-selected test in SidebarTabs-integ-test for handleShowInTree's post-showInTree ViewUtils.scrollElementIntoView (previously uncovered). - Drop the obsolete CCB-side button tests. --- .../CollapseFolders/main.js | 36 +++++---------- src/index.html | 10 ++-- src/styles/CentralControlBar.less | 19 -------- src/styles/Extn-CollapseFolders.less | 25 ++-------- test/spec/CentralControlBar-integ-test.js | 27 ----------- .../Extn-NavigationAndHistory-integ-test.js | 31 +++++++++++++ test/spec/SidebarTabs-integ-test.js | 46 +++++++++++++++++++ 7 files changed, 96 insertions(+), 98 deletions(-) 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..0891c01e7e 100644 --- a/src/index.html +++ b/src/index.html @@ -914,6 +914,10 @@ phcode.io @@ -965,12 +969,6 @@ -
-
- - - -