Skip to content

feat: add preferences to toggle the working set visibility #2202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
50b957e
feat: add preferences to toggle the working set visibility
devvaannsh Apr 6, 2025
680678e
ci: bump patch version to 4.1.1
abose Apr 9, 2025
660e67a
feat: add placeholder tabs when file is selected from file tree
devvaannsh Apr 10, 2025
7b99591
fix: tab bar not appearing when only a placeholder tab is present
devvaannsh Apr 10, 2025
6afae1f
fix: add directory name in placeholder tab when tab with same name al…
devvaannsh Apr 10, 2025
7755822
fix: scroll to active tab not working for placeholder tabs
devvaannsh Apr 10, 2025
579187e
fix: active tab styling for placeholder tabs in split pane
devvaannsh Apr 10, 2025
85170cd
chore: remove non pg13 explore project file
abose Apr 10, 2025
4563146
fix: github actions windows desktop tests fails after rust update, lo…
abose Apr 11, 2025
42f9708
fix: always reserve space for dirty icon to prevent tabs shift
devvaannsh May 14, 2025
47b7b65
feat: add rename and delete option in tab
devvaannsh May 14, 2025
074043d
fix: scrollbar appearing in tab context menu
devvaannsh May 14, 2025
203ab9c
fix: remove unused code
devvaannsh May 14, 2025
18552c1
feat: add show in file tree option in the tab context menu
devvaannsh May 14, 2025
577e3ad
fix: scroll bar appearing in commit dropdown
devvaannsh May 15, 2025
31b601d
fix: drag-drop bugs that was preventing smooth scroll
devvaannsh May 17, 2025
cebaa9b
fix: show active tab at all cases by replacing the last tab from the …
devvaannsh May 17, 2025
29e404b
fix: show display path in tabs instead of tauri path
devvaannsh May 17, 2025
8426afe
feat: show git change markers on tabs
devvaannsh May 18, 2025
88dc4c8
refactor: git markers styles in tabs
devvaannsh May 18, 2025
af979da
fix: git markers disappearing from tabs when files are staged
devvaannsh May 18, 2025
289dada
fix: git change markers color not properly visible in light theme
devvaannsh May 18, 2025
b166b71
refactor: file tab strings for delete, rename, show in file tree
abose May 21, 2025
6520fd7
feat: replace phoenix code support button with user profile button
devvaannsh May 16, 2025
d775dc6
feat: user profile implementation
devvaannsh May 16, 2025
691f168
fix: remove hard-coded values for easier integration
devvaannsh May 16, 2025
ca3c7f1
refactor: improve styles to align the UI with rest of Phoenix
devvaannsh May 16, 2025
5bf5e25
fix: changed styles file name to follow convention
devvaannsh May 16, 2025
aba1297
fix: use popup manager api's and improve readability
devvaannsh May 16, 2025
72a34b2
ci: update Translations
abose May 21, 2025
f2ad88c
feat: toggle tab bar and working set from sidebar
devvaannsh May 21, 2025
8b2014e
refactor: update tab bar string to make it consistent with view menu …
devvaannsh May 21, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/desktop-linux-prod-test-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
node-version: 20
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.85.1

- name: install dependencies (ubuntu only)
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/desktop-linux-test-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
node-version: 20
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.85.1

- name: install dependencies (ubuntu only)
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/desktop-mac-m1-test-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
node-version: 20
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.85.1

- name: build phoenix dist-test
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/desktop-mac-test-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
node-version: 20
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.85.1

- name: build phoenix dist-test
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/desktop-windows-test-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
node-version: 20
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.85.1

- name: build phoenix dist-test
run: |
Expand Down
12 changes: 12 additions & 0 deletions docs/API-Reference/command/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,18 @@ Sorts working set by file type
## CMD\_WORKING\_SORT\_TOGGLE\_AUTO
Toggles automatic working set sorting

**Kind**: global variable
<a name="CMD_TOGGLE_SHOW_WORKING_SET"></a>

## CMD\_TOGGLE\_SHOW\_WORKING\_SET
Toggles working set visibility

**Kind**: global variable
<a name="CMD_TOGGLE_SHOW_FILE_TABS"></a>

## CMD\_TOGGLE\_SHOW\_FILE\_TABS
Toggles file tabs visibility

**Kind**: global variable
<a name="CMD_KEYBOARD_NAV_UI_OVERLAY"></a>

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "phoenix",
"version": "4.1.0-0",
"apiVersion": "4.1.0",
"version": "4.1.1-0",
"apiVersion": "4.1.1",
"homepage": "https://core.ai",
"issues": {
"url": "https://github.com/phcode-dev/phoenix/issues"
Expand Down Expand Up @@ -117,4 +117,4 @@
"tinycolor2": "^1.4.2",
"underscore": "^1.13.4"
}
}
}
4 changes: 2 additions & 2 deletions src-node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src-node/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@phcode/node-core",
"description": "Phoenix Node Core",
"version": "4.1.0-0",
"apiVersion": "4.1.0",
"version": "4.1.1-0",
"apiVersion": "4.1.1",
"keywords": [],
"author": "[email protected]",
"homepage": "https://github.com/phcode-dev/phoenix",
Expand Down
319 changes: 0 additions & 319 deletions src/assets/sample-projects/explore/out_on_a_limb.html

This file was deleted.

6 changes: 6 additions & 0 deletions src/command/Commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,12 @@ define(function (require, exports, module) {
/** Toggles automatic working set sorting */
exports.CMD_WORKING_SORT_TOGGLE_AUTO = "cmd.sortWorkingSetToggleAuto"; // WorkingSetSort.js _handleToggleAutoSort()

/** Toggles working set visibility */
exports.CMD_TOGGLE_SHOW_WORKING_SET = "cmd.toggleShowWorkingSet"; // SidebarView.js _handleToggleWorkingSet()

/** Toggles file tabs visibility */
exports.CMD_TOGGLE_SHOW_FILE_TABS = "cmd.toggleShowFileTabs"; // SidebarView.js _handleToggleFileTabs()

/** Opens keyboard navigation UI overlay */
exports.CMD_KEYBOARD_NAV_UI_OVERLAY = "cmd.keyboardNavUI"; // WorkingSetSort.js _handleToggleAutoSort()

Expand Down
5 changes: 4 additions & 1 deletion src/command/DefaultMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ define(function (require, exports, module) {
splitview_menu.addMenuDivider();
splitview_menu.addMenuItem(Commands.CMD_WORKING_SORT_TOGGLE_AUTO);
splitview_menu.addMenuItem(Commands.FILE_SHOW_FOLDERS_FIRST);
splitview_menu.addMenuDivider();
splitview_menu.addMenuItem(Commands.CMD_TOGGLE_SHOW_WORKING_SET);
splitview_menu.addMenuItem(Commands.CMD_TOGGLE_SHOW_FILE_TABS);

var project_cmenu = Menus.registerContextMenu(Menus.ContextMenuIds.PROJECT_MENU);
project_cmenu.addMenuItem(Commands.FILE_NEW);
Expand Down Expand Up @@ -474,4 +477,4 @@ define(function (require, exports, module) {
Menus.getContextMenu(Menus.ContextMenuIds.WORKING_SET_CONTEXT_MENU).on("beforeContextMenuOpen", _setMenuItemsVisible);
Menus.getContextMenu(Menus.ContextMenuIds.PROJECT_MENU).on("beforeContextMenuOpen", _setMenuItemsVisible);
});
});
});
4 changes: 2 additions & 2 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"bugsnagEnv": "development"
},
"name": "Phoenix Code",
"version": "4.1.0-0",
"apiVersion": "4.1.0",
"version": "4.1.1-0",
"apiVersion": "4.1.1",
"homepage": "https://core.ai",
"issues": {
"url": "https://github.com/phcode-dev/phoenix/issues"
Expand Down
7 changes: 5 additions & 2 deletions src/extensions/default/Git/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ define(function (require, exports, module) {
"src/History",
"src/NoRepo",
"src/ProjectTreeMarks",
"src/Remotes"
"src/Remotes",
"src/TabBarIntegration"
];
require(modules);

Expand All @@ -48,10 +49,12 @@ define(function (require, exports, module) {

// export API's for other extensions
if (typeof window === "object") {
const TabBarIntegration = require("src/TabBarIntegration");
window.phoenixGitEvents = {
EventEmitter: EventEmitter,
Events: Events,
Git
Git,
TabBarIntegration
};
}
});
3 changes: 2 additions & 1 deletion src/extensions/default/Git/src/ErrorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ define(function (require, exports) {
exports.showError = function (err, title, options = {}) {
const dontStripError = options.dontStripError;
const errorMetric = options.errorMetric;
Metrics.countEvent(Metrics.EVENT_TYPE.GIT, 'dialogErr', errorMetric || "Show");
if (err.__shown) { return err; }

exports.logError(err);
Expand All @@ -71,13 +70,15 @@ define(function (require, exports) {
errorBody = window.debugMode ? `${errorBody}\n${errorStack}` : errorBody;

if(options.useNotification){
Metrics.countEvent(Metrics.EVENT_TYPE.GIT, 'notifyErr', errorMetric || "Show");
NotificationUI.createToastFromTemplate(title,
`<textarea readonly style="width: 200px; height: 200px; cursor: text; resize: none;">${errorBody}</textarea>`, {
toastStyle: NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.ERROR,
dismissOnClick: false,
instantOpen: true
});
} else {
Metrics.countEvent(Metrics.EVENT_TYPE.GIT, 'dialogErr', errorMetric || "Show");
const compiledTemplate = Mustache.render(errorDialogTemplate, {
title: title,
body: errorBody,
Expand Down
90 changes: 90 additions & 0 deletions src/extensions/default/Git/src/TabBarIntegration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
define(function (require) {
const EventEmitter = require("src/EventEmitter");
const Events = require("src/Events");
const Git = require("src/git/Git");
const Preferences = require("src/Preferences");

// the cache of file statuses by path
let fileStatusCache = {};

/**
* this function is responsible to get the Git status for a file path
*
* @param {string} fullPath - the file path
* @returns {Array|null} - Array of status strings or null if no status
*/
function getFileStatus(fullPath) {
return fileStatusCache[fullPath] || null;
}

/**
* whether the file is modified or not
*
* @param {string} fullPath - the file path
* @returns {boolean} - True if the file is modified otherwise false
*/
function isModified(fullPath) {
const status = getFileStatus(fullPath);
if (!status) {
return false;
}
return status.some(
(statusType) =>
statusType === Git.FILE_STATUS.MODIFIED ||
statusType === Git.FILE_STATUS.RENAMED ||
statusType === Git.FILE_STATUS.COPIED
);
}

/**
* whether the file is untracked or not
*
* @param {string} fullPath - the file path
* @returns {boolean} - True if the file is untracked otherwise false
*/
function isUntracked(fullPath) {
const status = getFileStatus(fullPath);
if (!status) {
return false;
}

// return true if it's untracked or if it's newly added (which means it was untracked before staging)
return (
status.includes(Git.FILE_STATUS.UNTRACKED) ||
(status.includes(Git.FILE_STATUS.ADDED) && status.includes(Git.FILE_STATUS.STAGED))
);
}


// Update file status cache when Git status results are received
EventEmitter.on(Events.GIT_STATUS_RESULTS, function (files) {
// reset the cache
fileStatusCache = {};

const gitRoot = Preferences.get("currentGitRoot");
if (!gitRoot) {
return;
}

// we need to update cache with new status results
files.forEach(function (entry) {
const fullPath = gitRoot + entry.file;
fileStatusCache[fullPath] = entry.status;
});

// notify that file statuses have been updated
EventEmitter.emit("GIT_FILE_STATUS_CHANGED", fileStatusCache);
});

// clear cache when Git is disabled
EventEmitter.on(Events.GIT_DISABLED, function () {
fileStatusCache = {};
EventEmitter.emit("GIT_FILE_STATUS_CHANGED", fileStatusCache);
});

return {
getFileStatus: getFileStatus,
isModified: isModified,
isUntracked: isUntracked
};
});
17 changes: 17 additions & 0 deletions src/extensionsIntegrated/Phoenix/html/login-dialog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="profile-popup">
<div class="popup-header">
<h1 class="popup-title">{{welcomeTitle}}</h1>
</div>
<div class="popup-body">
<button id="phoenix-signin-btn" class="btn btn-primary">
<i class="fa fa-sign-in-alt"></i>
{{signInBtnText}}
</button>
<div class="support-link">
<button id="phoenix-support-btn" class="btn btn-link">
<i class="fa fa-question-circle"></i>
{{supportBtnText}}
</button>
</div>
</div>
</div>
39 changes: 39 additions & 0 deletions src/extensionsIntegrated/Phoenix/html/profile-panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<div class="profile-popup">
<div class="popup-header">
<div class="user-profile-header">
<div class="user-avatar">
{{initials}}
</div>
<div class="user-info">
<div class="user-name">{{userName}}</div>
<div class="user-plan">{{planName}}</div>
</div>
</div>
</div>
<div class="popup-body">
<div class="quota-section">
<div class="quota-header">
<span>{{quotaLabel}}</span>
<span>{{quotaUsed}} / {{quotaTotal}} {{quotaUnit}}</span>
</div>
<div class="progress-bar">
<div class="progress-fill" style="width: {{quotaPercent}}%;"></div>
</div>
</div>

<button id="phoenix-account-btn" class="btn btn-default menu-button">
<i class="fa fa-user"></i>
{{accountBtnText}}
</button>

<button id="phoenix-support-btn" class="btn btn-default menu-button">
<i class="fa fa-question-circle"></i>
{{supportBtnText}}
</button>

<button id="phoenix-signout-btn" class="btn btn-default menu-button signout">
<i class="fa fa-sign-out-alt"></i>
{{signOutBtnText}}
</button>
</div>
</div>
11 changes: 6 additions & 5 deletions src/extensionsIntegrated/Phoenix/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,24 @@ define(function (require, exports, module) {
Strings = require("strings"),
Dialogs = require("widgets/Dialogs"),
NotificationUI = require("widgets/NotificationUI"),
DefaultDialogs = require("widgets/DefaultDialogs");
DefaultDialogs = require("widgets/DefaultDialogs"),
ProfileMenu = require("./profile-menu");

const PERSIST_STORAGE_DIALOG_DELAY_SECS = 60000;
let $icon;

function _addToolbarIcon() {
const helpButtonID = "help-button";
const helpButtonID = "user-profile-button";
$icon = $("<a>")
.attr({
id: helpButtonID,
href: "#",
class: "help",
title: Strings.CMD_SUPPORT
class: "user",
title: Strings.CMD_USER_PROFILE
})
.appendTo($("#main-toolbar .bottom-buttons"));
$icon.on('click', ()=>{
Phoenix.app.openURLInDefaultBrowser(brackets.config.support_url);
ProfileMenu.init();
});
}
function _showUnSupportedBrowserDialogue() {
Expand Down
Loading
Loading