fix(apollo-react): handles in flow [MST-6514]#244
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR fixes a visual issue where the "add" button in canvas flow handles was being hidden due to overlapping text labels. The fix adds conditional text truncation for handle labels when they appear alongside buttons on horizontal positions (Left/Right).
Changes:
- Added logic to truncate handle labels when a button needs to be displayed alongside them
- Label truncation only applies to source handles with buttons on horizontal positions (Left/Right)
- Implemented using a max-width constraint (50px) and CSS text-overflow ellipsis
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/apollo-react/src/canvas/components/ButtonHandle/ButtonHandle.tsx | Added shouldTruncateLabel logic and conditional styling to truncate text when button is shown on horizontal positions |
| packages/apollo-react/src/canvas/components/ButtonHandle/ButtonHandle.styles.tsx | Added $shouldTruncate prop to StyledLabel that applies max-width and overflow styles when enabled |
Comments suppressed due to low confidence (1)
packages/apollo-react/src/canvas/components/ButtonHandle/ButtonHandle.tsx:194
- When text is truncated, a tooltip should be added to display the full label text. This follows the pattern used in other canvas components like Breadcrumb (Breadcrumb.tsx:76) which uses
ApTooltipwith thesmartTooltipprop to show tooltips only when text is actually truncated. Without a tooltip, users cannot see the full label text when it's truncated.
{label && (
<StyledLabel
$position={position}
$backgroundColor={labelBackgroundColor}
$shouldTruncate={shouldTruncateLabel}
>
<Row align="center" gap={4}>
{labelIcon}
<ApTypography
color="var(--uix-canvas-foreground-de-emp)"
variant={FontVariantToken.fontSizeSBold}
sx={
shouldTruncateLabel
? {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}
: undefined
}
>
{label}
</ApTypography>
</Row>
</StyledLabel>
)}
packages/apollo-react/src/canvas/components/ButtonHandle/ButtonHandle.tsx
Outdated
Show resolved
Hide resolved
packages/apollo-react/src/canvas/components/ButtonHandle/ButtonHandle.tsx
Outdated
Show resolved
Hide resolved
packages/apollo-react/src/canvas/components/ButtonHandle/ButtonHandle.styles.tsx
Show resolved
Hide resolved
Contributor
|
I think It would be better if we show the complete text in tooltip when the label is truncated |
snuziale
approved these changes
Feb 18, 2026
CalinaCristian
approved these changes
Feb 18, 2026
432db39 to
a4ee0c6
Compare
a4ee0c6 to
a27ba30
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add button was hidden due to text label for handles.
limitize the text length when add button needs to be shown
Screen.Recording.2026-02-18.at.2.24.22.PM.mov