From 84691fc8734b97fe9f56240200124ca04d571e40 Mon Sep 17 00:00:00 2001 From: Waleed Date: Mon, 19 Jan 2026 23:52:07 -0800 Subject: [PATCH] improvement(modal): fixed popover issue in custom tools modal, removed the ability to update if no changes made (#2897) * improvement(modal): fixed popover issue in custom tools modal, removed the ability to update if no changes made * improvement(modal): fixed popover issue in custom tools modal, removed the ability to update if no changes made * popover fixes, color picker keyboard nav, code simplification * color standardization * fix color picker * set discard alert state when closing modal --- .../base-tags-modal/base-tags-modal.tsx | 4 +- .../components/general/general.tsx | 2 +- .../components/deploy-modal/deploy-modal.tsx | 5 +- .../components/code-editor/code-editor.tsx | 6 +- .../custom-tool-modal/custom-tool-modal.tsx | 232 ++++++++---------- .../access-control/access-control.tsx | 2 +- .../create-api-key-modal.tsx | 4 +- .../settings-modal/components/byok/byok.tsx | 4 +- .../components/copilot/copilot.tsx | 4 +- .../components/environment/environment.tsx | 2 +- .../components/general/general.tsx | 2 +- .../components/team-seats/team-seats.tsx | 2 +- .../components/context-menu/context-menu.tsx | 18 +- .../workspace-header/workspace-header.tsx | 1 + .../emcn/components/popover/popover.tsx | 7 + 15 files changed, 142 insertions(+), 153 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/base-tags-modal/base-tags-modal.tsx b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/base-tags-modal/base-tags-modal.tsx index 80dafafcf..282a85622 100644 --- a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/base-tags-modal/base-tags-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/base-tags-modal/base-tags-modal.tsx @@ -462,7 +462,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM Documents using "{selectedTag?.displayName}"
-

+

{selectedTagUsage?.documentCount || 0} document {selectedTagUsage?.documentCount !== 1 ? 's are' : ' is'} currently using this tag definition. @@ -470,7 +470,7 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM {selectedTagUsage?.documentCount === 0 ? (

-

+

This tag definition is not being used by any documents. You can safely delete it to free up the tag slot.

diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/general.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/general.tsx index 218e032f1..28e66c2c4 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/general.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/general.tsx @@ -283,7 +283,7 @@ export function GeneralDeploy({ Promote to live -

+

Are you sure you want to promote{' '} {versionToPromoteInfo?.name || `v${versionToPromote}`} diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx index fdaaefb54..09138be70 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx @@ -591,12 +591,11 @@ export function DeployModal({ )} {activeTab === 'api' && ( -

+
+
-
-
@@ -1248,6 +1200,26 @@ try { + + + + Unsaved Changes + +

+ You have unsaved changes to this tool. Are you sure you want to discard your changes + and close the editor? +

+
+ + + + +
+
) } diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/access-control/access-control.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/access-control/access-control.tsx index 067db3cc9..9b3fd8a02 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/access-control/access-control.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/access-control/access-control.tsx @@ -1072,7 +1072,7 @@ export function AccessControl() { Unsaved Changes -

+

You have unsaved changes. Do you want to save them before closing?

diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/components/create-api-key-modal/create-api-key-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/components/create-api-key-modal/create-api-key-modal.tsx index 14fec1b65..439280bf2 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/components/create-api-key-modal/create-api-key-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/components/create-api-key-modal/create-api-key-modal.tsx @@ -115,7 +115,7 @@ export function CreateApiKeyModal({ Create new API key -

+

{keyType === 'workspace' ? "This key will have access to all workflows in this workspace. Make sure to copy it after creation as you won't be able to see it again." : "This key will have access to your personal workflows. Make sure to copy it after creation as you won't be able to see it again."} @@ -218,7 +218,7 @@ export function CreateApiKeyModal({ Your API key has been created -

+

This is the only time you will see your API key.{' '} Copy it now and store it securely. diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/byok/byok.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/byok/byok.tsx index 449c3bb44..b8304402b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/byok/byok.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/byok/byok.tsx @@ -222,7 +222,7 @@ export function BYOK() { )} -

+

This key will be used for all {PROVIDERS.find((p) => p.id === editingProvider)?.name}{' '} requests in this workspace. Your key is encrypted and stored securely.

@@ -308,7 +308,7 @@ export function BYOK() { Delete API Key -

+

Are you sure you want to delete the{' '} {PROVIDERS.find((p) => p.id === deleteConfirmProvider)?.name} diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/copilot/copilot.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/copilot/copilot.tsx index e2d85bca6..5d160762b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/copilot/copilot.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/copilot/copilot.tsx @@ -214,7 +214,7 @@ export function Copilot() { Create new API key -

+

This key will allow access to Copilot features. Make sure to copy it after creation as you won't be able to see it again.

@@ -276,7 +276,7 @@ export function Copilot() { Your API key has been created -

+

This is the only time you will see your API key.{' '} Copy it now and store it securely. diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/environment/environment.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/environment/environment.tsx index 7f22ca396..026d646ca 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/environment/environment.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/environment/environment.tsx @@ -824,7 +824,7 @@ export function EnvironmentVariables({ registerBeforeLeaveHandler }: Environment Unsaved Changes -

+

{hasConflicts || hasInvalidKeys ? `You have unsaved changes, but ${hasConflicts ? 'conflicts must be resolved' : 'invalid variable names must be fixed'} before saving. You can discard your changes to close the modal.` : 'You have unsaved changes. Do you want to save them before closing?'} diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx index 6fbda0207..7ab1d0737 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx @@ -603,7 +603,7 @@ export function General({ onOpenChange }: GeneralProps) { Reset Password -

+

A password reset link will be sent to{' '} {profile?.email}. Click the link in the email to create a new password. diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/team-management/components/team-seats/team-seats.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/team-management/components/team-seats/team-seats.tsx index 82418420e..af4a52f9d 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/team-management/components/team-seats/team-seats.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/team-management/components/team-seats/team-seats.tsx @@ -64,7 +64,7 @@ export function TeamSeats({ {title} -

{description}

+

{description}