-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[plugin] : align tree item description properly #7237
Conversation
cc @vince-fugnitto feel free to merge if it is good for the release |
Signed-off-by: Anton Kosyakov <[email protected]>
ccf8b37
to
7f8494b
Compare
@@ -254,7 +254,7 @@ export class TreeViewWidget extends TreeWidget { | |||
return React.createElement('div', attrs, ...children); | |||
} | |||
|
|||
protected getCaption(node: TreeNode): React.ReactNode[] { | |||
protected getCaption(node: TreeNode): React.ReactNode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main trick is that we turn each element to span that it does not create multiple lines and then wrap them into div element with block display and noWrapInfo
class install. It makes sure that all span are treated as one element and get trimmed accordingly only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to solve this issue already many times and each time it is hard for me, had to remember that text overflow does not play nicely with flex display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified the changes using the vscode tree-view sample and everything worked correctly 👍
The caption was displayed to the left, and ellipsis were shown when the view was constrained.
I'm including the fix in the release since it fixes an issue that affects all plugin trees, and was introduced during the month. |
What it does
How to test
Review checklist
Reminder for reviewers