From 74d6843bb3a6b68b6be10ac4b1d0cc57a51b065b Mon Sep 17 00:00:00 2001 From: saadberry Date: Mon, 29 Sep 2025 21:38:55 +0500 Subject: [PATCH 01/11] Early returning if no project detected --- .../intellij/sdk/codesync/actions/CodeSyncActionGroup.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java index 418da31..e2d178b 100644 --- a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java +++ b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java @@ -70,6 +70,11 @@ public void update(@NotNull AnActionEvent e) { visible = false; } + if (project == null) { + presentation.setVisible(false); + return; + } + VirtualFile repoRoot = this.getRepoRoot(e, project); if (repoRoot == null) { visible = false; From 4478cae0249d7cedf8ec2d439b894ac86bd23818 Mon Sep 17 00:00:00 2001 From: saadberry Date: Mon, 29 Sep 2025 21:55:44 +0500 Subject: [PATCH 02/11] Minor fix --- .../org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java index e2d178b..10c6e9e 100644 --- a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java +++ b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java @@ -71,7 +71,7 @@ public void update(@NotNull AnActionEvent e) { } if (project == null) { - presentation.setVisible(false); + e.getPresentation().setVisible(visible); return; } From 25c0a5e9ae5c8e8813921762ed685ba8d7e94938 Mon Sep 17 00:00:00 2001 From: saadberry Date: Tue, 30 Sep 2025 20:47:03 +0500 Subject: [PATCH 03/11] Updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59567da..3032ef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [4.9.0] - 2025-09-25 +## [4.9.1] - 2025-09-30 - Disables CodeSync group if an invalid project is opened ## [4.8.0] - 2025-03-11 From 9e6ab7bf53e710f18420a49bcb98006151631fc0 Mon Sep 17 00:00:00 2001 From: saadberry Date: Tue, 30 Sep 2025 20:51:38 +0500 Subject: [PATCH 04/11] Updating version in build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a05aa43..085d32f 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { } group 'com.codesync' -version '4.9.0' +version '4.9.1' compileJava.options.encoding = "UTF-8" From f4914b57e847767123b8a80eb06ad0781027c241 Mon Sep 17 00:00:00 2001 From: saadberry Date: Wed, 1 Oct 2025 20:19:36 +0500 Subject: [PATCH 05/11] Accessing isDirectory() only if repoRoot is not null --- .../sdk/codesync/actions/CodeSyncActionGroup.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java index 10c6e9e..27ad015 100644 --- a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java +++ b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java @@ -78,15 +78,13 @@ public void update(@NotNull AnActionEvent e) { VirtualFile repoRoot = this.getRepoRoot(e, project); if (repoRoot == null) { visible = false; + } else { + // A single file is opened, no need to sync it. + if (!repoRoot.isDirectory()) { + visible = false; + showStatusBarMessage(StatusBarMessages.OPEN_FOLDER, project); + } } - - // A single file is opened, no need to sync it. - if (!repoRoot.isDirectory()) { - visible = false; - // Display alert message - showStatusBarMessage(StatusBarMessages.OPEN_FOLDER, project); - } - e.getPresentation().setVisible(visible); e.getPresentation().setEnabled(visible); } From bf8182e9e3e3163541924916090c21970ce04ac0 Mon Sep 17 00:00:00 2001 From: saadberry Date: Wed, 1 Oct 2025 20:19:50 +0500 Subject: [PATCH 06/11] Updating Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3032ef9..8487853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [4.9.1] - 2025-09-30 +## [4.9.2] - 2025-10-01 - Disables CodeSync group if an invalid project is opened ## [4.8.0] - 2025-03-11 From 91a7e6ee76913eff4669d773177dbb1c2b7f3433 Mon Sep 17 00:00:00 2001 From: saadberry Date: Wed, 1 Oct 2025 20:20:09 +0500 Subject: [PATCH 07/11] Bumping version in build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 085d32f..669ab8a 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { } group 'com.codesync' -version '4.9.1' +version '4.9.2' compileJava.options.encoding = "UTF-8" From 2eebc8ec4b34cdd4ee6dd1b0e93eda4d24362258 Mon Sep 17 00:00:00 2001 From: saadberry Date: Mon, 6 Oct 2025 12:14:09 +0500 Subject: [PATCH 08/11] Adding invalid proj. error messages in Notification class --- .../java/org/intellij/sdk/codesync/Constants.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/intellij/sdk/codesync/Constants.java b/src/main/java/org/intellij/sdk/codesync/Constants.java index 8edfacb..4d3f479 100644 --- a/src/main/java/org/intellij/sdk/codesync/Constants.java +++ b/src/main/java/org/intellij/sdk/codesync/Constants.java @@ -201,6 +201,10 @@ private Notification() { public static final String ACCOUNT_DEACTIVATED = "Your account has been deactivated. Please click 'Reactivate Account' below to resume syncing."; public static final String ACCOUNT_REACTIVATE_BUTTON = "Reactivate Account"; public static final String REACTIVATED_SUCCESS = "Successfully reactivated your account"; + + // Invalid project related notification messages + public static final String INVALID_PROJECT_OPEN_FOLDER = "CodeSync only works with folders. Please open a folder to start syncing."; + public static final String INVALID_PROJECT_ACCOUNT_DEACTIVATED = "Your account is deactivated. In order to use CodeSync’s features, please use an active account."; } @@ -262,11 +266,4 @@ private CustomErrorCodes() { public static final int IS_FROZEN_REPO = 4000; public static final int PRIVATE_REPO_COUNT_LIMIT_REACHED = 4006; } - - public static final class StatusBarMessages { - public static final String OPEN_FOLDER = "CodeSync notification: CodeSync only works with folders. Please open a folder to start syncing."; - public static final String ACCOUNT_DEACTIVATED = "CodeSync notification: Your account is deactivated. In order to use CodeSync’s features, please use an active account."; - } } - - From df2b512ad822d61d198c22c95ea1128750e6542b Mon Sep 17 00:00:00 2001 From: saadberry Date: Mon, 6 Oct 2025 12:15:38 +0500 Subject: [PATCH 09/11] Displaying balloon alert instead of Status bar alert --- .../codesync/actions/CodeSyncActionGroup.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java index 27ad015..1800b2c 100644 --- a/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java +++ b/src/main/java/org/intellij/sdk/codesync/actions/CodeSyncActionGroup.java @@ -16,6 +16,7 @@ import org.intellij.sdk.codesync.utils.ProjectUtils; import com.intellij.openapi.ui.Messages; import org.intellij.sdk.codesync.Constants.*; +import org.intellij.sdk.codesync.NotificationManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.wm.StatusBar; @@ -57,12 +58,15 @@ public void update(@NotNull AnActionEvent e) { Project project = e.getProject(); boolean visible = true; - // Hide group if account is deactivated if (StateUtils.getGlobalState().isAccountDeactivated) { visible = false; // Display alert message - showStatusBarMessage(StatusBarMessages.ACCOUNT_DEACTIVATED, project); + NotificationManager.getInstance().notifyInformation( + Notification.INVALID_PROJECT_ACCOUNT_DEACTIVATED, project + ); + // Setting wasAlertShown=true so it only shows once + wasAlertShown = true; } // Hide group if invalid project path @@ -82,7 +86,13 @@ public void update(@NotNull AnActionEvent e) { // A single file is opened, no need to sync it. if (!repoRoot.isDirectory()) { visible = false; - showStatusBarMessage(StatusBarMessages.OPEN_FOLDER, project); + if (!wasAlertShown) { + NotificationManager.getInstance().notifyInformation( + Notification.INVALID_PROJECT_OPEN_FOLDER, project + ); + // Setting wasAlertShown=true so it only shows once + wasAlertShown = true; + } } } e.getPresentation().setVisible(visible); From 415b6191c02ce1e4709320e5df6bda38850140e3 Mon Sep 17 00:00:00 2001 From: saadberry Date: Tue, 7 Oct 2025 10:18:09 +0500 Subject: [PATCH 10/11] Updated date in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8487853..c4234f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [4.9.2] - 2025-10-01 +## [4.9.3] - 2025-10-06 - Disables CodeSync group if an invalid project is opened ## [4.8.0] - 2025-03-11 From 0c39e3a5913203378acfed343e938babed46deeb Mon Sep 17 00:00:00 2001 From: saadberry Date: Tue, 7 Oct 2025 10:19:38 +0500 Subject: [PATCH 11/11] Updated version in build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 669ab8a..513d1c9 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { } group 'com.codesync' -version '4.9.2' +version '4.9.3' compileJava.options.encoding = "UTF-8"