chenlica opened a new pull request, #5071: URL: https://github.com/apache/texera/pull/5071
### What changes were proposed in this PR? When the user sets a very long custom display name (caption) on an operator, the caption rendered on the workflow canvas overflows the operator's bounding box and overlaps neighboring elements (see screenshot in #5070). This PR caps the rendered caption length so it stays visually contained: - Add `JointUIService.MAX_OPERATOR_NAME_LENGTH` (30) and a pure helper `JointUIService.truncateOperatorDisplayName(name)` that returns `name` unchanged when it is within the limit, or `name.slice(0, MAX - 3) + "..."` otherwise. - Apply the helper at the two places where the caption is pushed into the JointJS text element: the initial render in the operator-element factory, and the rename handler `changeOperatorJointDisplayName`. The underlying `customDisplayName` on the operator model is **not** modified — only the rendered string is truncated. The full caption is preserved on the workflow data and remains visible/editable wherever it is shown outside the canvas. ### Any related issues, documentation, discussions? Fixes apache/texera#5070. ### How was this PR tested? - Added focused unit tests for `truncateOperatorDisplayName` covering: name within the limit (unchanged), name over the limit (truncated to exactly `MAX_OPERATOR_NAME_LENGTH` chars with a trailing `...`), and empty string (unchanged). - Manual reproduction from the linked issue: setting a >30-char caption on an operator. With this change, the rendered caption is truncated with an ellipsis and no longer overflows. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.7) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
