Skip to content
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

Merged
merged 1 commit into from
Feb 27, 2020

Conversation

akosyakov
Copy link
Member

What it does

How to test

Review checklist

Reminder for reviewers

@akosyakov akosyakov added plug-in system issues related to the plug-in system tree issues related to the tree (ex: tree widget) labels Feb 27, 2020
@akosyakov
Copy link
Member Author

cc @vince-fugnitto feel free to merge if it is good for the release

@akosyakov akosyakov force-pushed the akosyakov/regression-description-7199 branch from ccf8b37 to 7f8494b Compare February 27, 2020 16:25
@@ -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 {
Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

@vince-fugnitto vince-fugnitto left a 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.

@vince-fugnitto
Copy link
Member

I'm including the fix in the release since it fixes an issue that affects all plugin trees, and was introduced during the month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system tree issues related to the tree (ex: tree widget)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[regression] description is not aligned properly in the plugin tree
2 participants