From f46444e0392d1abc7b3c28547e4479129f7aba39 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sat, 15 Nov 2025 17:46:14 -0600 Subject: [PATCH] refactor: simplify deployment description toggle logic - Removed the separate toggleDescription function and integrated its logic directly into the button's onClick handler for better readability. - Maintained functionality for expanding and collapsing deployment descriptions while streamlining the code structure. --- .../deployments/show-deployments.tsx | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx b/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx index 8e7eb66ca..1885ffc3a 100644 --- a/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx +++ b/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx @@ -100,26 +100,12 @@ export const ShowDeployments = ({ } const truncated = description.slice(0, MAX_DESCRIPTION_LENGTH); const lastSpace = truncated.lastIndexOf(" "); - // Truncate at word boundary if found near the end if (lastSpace > MAX_DESCRIPTION_LENGTH - 20 && lastSpace > 0) { return `${truncated.slice(0, lastSpace)}...`; } return `${truncated}...`; }; - // Toggle expand/collapse state for a specific deployment - const toggleDescription = (deploymentId: string) => { - setExpandedDescriptions((prev) => { - const next = new Set(prev); - if (next.has(deploymentId)) { - next.delete(deploymentId); - } else { - next.add(deploymentId); - } - return next; - }); - }; - // Check for stuck deployment (more than 9 minutes) - only for the most recent deployment const stuckDeployment = useMemo(() => { if (!isCloud || !deployments || deployments.length === 0) return null; @@ -286,9 +272,15 @@ export const ShowDeployments = ({ {needsTruncation && (