From 5ec2dd4b6c725af13d0c06f5760d497149a4802a Mon Sep 17 00:00:00 2001 From: master <> Date: Thu, 2 Apr 2026 17:12:20 +0300 Subject: [PATCH] Remove backtrack endpoint: truncate path at pre-overshoot point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a backtrack's return point is the endpoint (last point), remove BOTH the overshoot and return — the pre-overshoot point becomes the new endpoint. This prevents the rendered path from bending inside the target node after backtrack removal. edge/4 now ends cleanly at the Join's left face instead of bending UP inside the node. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Options/MessagingTransportOptions.cs | 2 +- .../WorkflowRenderSvgRenderer.cs | 30 +++++++++++++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/Router/__Libraries/StellaOps.Router.Transport.Messaging/Options/MessagingTransportOptions.cs b/src/Router/__Libraries/StellaOps.Router.Transport.Messaging/Options/MessagingTransportOptions.cs index c2638b70a..b3c2bb00a 100644 --- a/src/Router/__Libraries/StellaOps.Router.Transport.Messaging/Options/MessagingTransportOptions.cs +++ b/src/Router/__Libraries/StellaOps.Router.Transport.Messaging/Options/MessagingTransportOptions.cs @@ -41,7 +41,7 @@ public class MessagingTransportOptions /// /// Gets or sets the timeout for RPC requests. /// - public TimeSpan RequestTimeout { get; set; } = TimeSpan.FromSeconds(30); + public TimeSpan RequestTimeout { get; set; } = TimeSpan.FromSeconds(55); /// /// Gets or sets the lease duration for message processing. diff --git a/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs b/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs index 571dbc50d..0706675d7 100644 --- a/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs +++ b/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs @@ -2044,7 +2044,9 @@ public sealed class WorkflowRenderSvgRenderer // Remove backtracks: when three consecutive points are on the same // axis (same X or same Y) and the middle one overshoots then returns, - // remove the overshoot point. + // remove the overshoot AND the return point (keep the pre-overshoot + // as the new endpoint). This prevents the path from bending inside + // the target node after the backtrack removal. for (var i = 1; i < mutablePoints.Count - 1; i++) { var prev = mutablePoints[i - 1]; @@ -2054,13 +2056,21 @@ public sealed class WorkflowRenderSvgRenderer var sameY = Math.Abs(prev.Y - curr.Y) < 2d && Math.Abs(curr.Y - next.Y) < 2d; if (sameX) { - // All three on same X. Check if curr overshoots: prev→curr goes - // one direction, curr→next goes the opposite. var d1 = curr.Y - prev.Y; var d2 = next.Y - curr.Y; - if (d1 * d2 < 0d) // opposite directions = backtrack + if (d1 * d2 < 0d) { - mutablePoints.RemoveAt(i); + // Remove overshoot. If next is the last point (endpoint), + // also remove it — prev becomes the new endpoint. + if (i + 1 == mutablePoints.Count - 1) + { + mutablePoints.RemoveRange(i, 2); + } + else + { + mutablePoints.RemoveAt(i); + } + i--; continue; } @@ -2072,7 +2082,15 @@ public sealed class WorkflowRenderSvgRenderer var d2 = next.X - curr.X; if (d1 * d2 < 0d) { - mutablePoints.RemoveAt(i); + if (i + 1 == mutablePoints.Count - 1) + { + mutablePoints.RemoveRange(i, 2); + } + else + { + mutablePoints.RemoveAt(i); + } + i--; continue; }