From 3f026a677beb09f5e2cb643dd191a01e215d5036 Mon Sep 17 00:00:00 2001 From: abose Date: Wed, 18 Dec 2024 16:17:16 +0530 Subject: [PATCH 1/2] chore: update css of project dropdown to accomedate git branch dropdown --- src/styles/Extn-RecentProjects.less | 21 +++++++++++++++------ src/styles/brackets.less | 6 ++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/styles/Extn-RecentProjects.less b/src/styles/Extn-RecentProjects.less index 46c8bf4454..2465b24770 100644 --- a/src/styles/Extn-RecentProjects.less +++ b/src/styles/Extn-RecentProjects.less @@ -45,18 +45,27 @@ } #project-dropdown-toggle { - display: inline-block; + display: flex; /* adjust margins to keep position #project-title position stable after extension is loaded */ - margin: -3px 5px -2px -6px; overflow: hidden; - padding: 0 5px; white-space: nowrap; + padding: 2px 5px; + margin-left: -5px; + .dropdown-arrow { + display: inline-block; + width: 7px; + height: 5px; + margin-left: 4px; + position: relative; + top: 7px; + } } #project-title { - /* vertical align center text */ - height: 21px; - line-height: 21px; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + flex: 1 1 0; } #project-dropdown-toggle:hover .dropdown-arrow { diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 9b7a520ed3..fca8d95faa 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1325,10 +1325,11 @@ a, img { display: flex; align-items: center; border-top: 1px solid rgba(255, 255, 255, 0.05); - padding: 8px 0 9px 12px; + padding: 6px 0 6px 12px; font-size: 15px; color: @project-panel-text-2; overflow: hidden; + gap: .5em; .btn-alt-quiet { background-color: #47484b; @@ -1340,7 +1341,8 @@ a, img { } #project-operations-spinner{ - margin-right: 7px; + margin-right: 5px; + margin-top: 0; } .open-files-container { From dfe4b674fa06f8d3245d4b00b365f784732c2595 Mon Sep 17 00:00:00 2001 From: abose Date: Wed, 18 Dec 2024 17:14:10 +0530 Subject: [PATCH 2/2] chore: project dropdown location display change , rendering html and styles --- src/extensionsIntegrated/RecentProjects/main.js | 4 +--- src/index.html | 5 ++++- src/phoenix/shell.js | 4 ++-- test/spec/LowLevelFileIO-test.js | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/extensionsIntegrated/RecentProjects/main.js b/src/extensionsIntegrated/RecentProjects/main.js index 0ccb33e0ef..f7d1a8db8a 100644 --- a/src/extensionsIntegrated/RecentProjects/main.js +++ b/src/extensionsIntegrated/RecentProjects/main.js @@ -548,9 +548,7 @@ define(function (require, exports, module) { }); AppInit.htmlReady(function () { - $("#project-title") - .wrap("
") - .after(""); + $("#project-dropdown-toggle .dropdown-arrow").removeClass("forced-hidden"); var cmenuAdapter = { open: showDropdown, diff --git a/src/index.html b/src/index.html index 38453eb405..490e34c408 100644 --- a/src/index.html +++ b/src/index.html @@ -824,7 +824,10 @@
- +
+ + +
diff --git a/src/phoenix/shell.js b/src/phoenix/shell.js index ae8a61533e..e9e518a2ab 100644 --- a/src/phoenix/shell.js +++ b/src/phoenix/shell.js @@ -19,7 +19,7 @@ // jshint ignore: start /*eslint no-console: 0*/ /*eslint strict: ["error", "global"]*/ -/*global Phoenix, fs*/ +/*global fs, path*/ /** Setup phoenix shell components @@ -334,7 +334,7 @@ Phoenix.app = { if (fullVFSPath.startsWith(Phoenix.VFS.getMountDir())) { return fullVFSPath.replace(Phoenix.VFS.getMountDir(), ""); } - return window.Strings.STORED_IN_YOUR_BROWSER; + return `${path.basename(fullVFSPath)} - ${window.Strings.STORED_IN_YOUR_BROWSER}`; }, getDisplayPath: function (fullOrRelativeVFSPath) { if(!fullOrRelativeVFSPath){ diff --git a/test/spec/LowLevelFileIO-test.js b/test/spec/LowLevelFileIO-test.js index f9ff481199..7b72eb897c 100644 --- a/test/spec/LowLevelFileIO-test.js +++ b/test/spec/LowLevelFileIO-test.js @@ -110,8 +110,8 @@ define(function (require, exports, module) { expect(brackets.app.getDisplayLocation("/mnt/apple")).toBe("apple"); expect(brackets.app.getDisplayLocation("/mnt/apple/x/")).toBe("apple/x/"); // filer paths - expect(brackets.app.getDisplayLocation("/x/apple")).toBe(Strings.STORED_IN_YOUR_BROWSER); - expect(brackets.app.getDisplayLocation("/y/apple/x/")).toBe(Strings.STORED_IN_YOUR_BROWSER); + expect(brackets.app.getDisplayLocation("/x/apple")).toBe("apple - "+ Strings.STORED_IN_YOUR_BROWSER); + expect(brackets.app.getDisplayLocation("/y/apple/x/")).toBe("x - " + Strings.STORED_IN_YOUR_BROWSER); }); it("should getDisplayLocation return correct path in tauri", function () {