-
Notifications
You must be signed in to change notification settings - Fork 65
[DS 2.0] Keep node title and subtitle on one line with ellipsis and tooltip #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
librowski
merged 2 commits into
ds2-persist-without-measured
from
ds2-node-text-ellipsis
Sep 16, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@workflowbuilder/sdk': patch | ||
| --- | ||
|
|
||
| Decision branch rows and AI tool rows show the full label in a tooltip when the text is truncated. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@workflowbuilder/ui': patch | ||
| --- | ||
|
|
||
| `NodeDescription` keeps both the title and the subtitle on one line: long text is truncated with an ellipsis and exposed in full through the element's native tooltip, and the text no longer widens nodes whose body sizes to its content (for example the Decision node). Nodes keep the fixed design width and grow in height only. |
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
25 changes: 25 additions & 0 deletions
25
...ages/sdk/src/features/diagram/nodes/components/connectable-item/connectable-item.spec.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { render, screen } from '@testing-library/react'; | ||
| import { describe, expect, it, vi } from 'vitest'; | ||
|
|
||
| import { ConnectableItem } from './connectable-item'; | ||
|
|
||
| vi.mock('@xyflow/react', () => ({ | ||
| Handle: ({ id }: { id: string }) => <span data-testid="handle" data-handle-id={id} />, | ||
| Position: { Right: 'right', Bottom: 'bottom' }, | ||
| })); | ||
|
|
||
| vi.mock('../../../../../store/store', () => ({ | ||
| useStore: (selector: (state: { layoutDirection: 'RIGHT' | 'DOWN' }) => unknown) => | ||
| selector({ layoutDirection: 'RIGHT' }), | ||
| })); | ||
|
|
||
| describe('ConnectableItem', () => { | ||
| it('exposes the full label as a tooltip so a clipped row stays readable', () => { | ||
| const label = 'Small and medium business with an unusually long branch label'; | ||
|
|
||
| render(<ConnectableItem handleId="source:inner:b2" label={label} />); | ||
|
|
||
| expect(screen.getByText(label).getAttribute('title')).toBe(label); | ||
| expect(screen.getByTestId('handle').dataset.handleId).toBe('source:inner:b2'); | ||
| }); | ||
| }); |
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
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
39 changes: 39 additions & 0 deletions
39
packages/ui/src/components/node/node-description/node-description.spec.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { act } from 'react'; | ||
| import { type Root, createRoot } from 'react-dom/client'; | ||
|
|
||
| import { NodeDescription } from './node-description'; | ||
|
|
||
| (globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true; | ||
|
|
||
| let container: HTMLDivElement; | ||
| let root: Root; | ||
|
|
||
| beforeEach(() => { | ||
| container = document.createElement('div'); | ||
| document.body.append(container); | ||
| root = createRoot(container); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| act(() => root.unmount()); | ||
| container.remove(); | ||
| }); | ||
|
|
||
| describe('NodeDescription', () => { | ||
| it('exposes the full label and description as native tooltips for truncated text', () => { | ||
| act(() => | ||
| root.render(<NodeDescription label="Route by Type" description="Sends the ticket to the right responder." />), | ||
| ); | ||
|
|
||
| const [title, subtitle] = container.querySelectorAll('span'); | ||
| expect(title.getAttribute('title')).toBe('Route by Type'); | ||
| expect(subtitle.getAttribute('title')).toBe('Sends the ticket to the right responder.'); | ||
| }); | ||
|
|
||
| it('renders no tooltip attribute when there is no description', () => { | ||
| act(() => root.render(<NodeDescription label="Start" />)); | ||
|
|
||
| const [, subtitle] = container.querySelectorAll('span'); | ||
| expect(subtitle.hasAttribute('title')).toBe(false); | ||
| }); | ||
| }); |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.