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

Highlight label should not create extra span nodes #164657

Merged
merged 4 commits into from
Nov 1, 2022

Conversation

mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Oct 25, 2022

I noticed that the HighlightedLabel class creates extra span elements for text ranges. These should not be needed. Using text children directly should be faster for creation and also reduce the number of nodes in the document

I also replaced the conditional spread with a longer version that uses a simple call to push. This is worth doing since HighlightedLabel is so widely used in the editor

I noticed that the `HighlightedLabel` class creates extra `span` elements for text ranges. These should not be needed. Using text children directly should be faster for creation and also reduce the number of nodes in the document

I also related the conditional spread with a longer version that uses a simple call to push. This is worth doing since `HighlightedLabel` is so widely used in the editor
@mjbvz mjbvz added this to the November 2022 milestone Oct 25, 2022
@mjbvz mjbvz self-assigned this Oct 25, 2022
@mjbvz mjbvz marked this pull request as ready for review October 28, 2022 21:19
@mjbvz mjbvz requested review from jrieken and aeschli October 28, 2022 21:19
@aeschli
Copy link
Contributor

aeschli commented Oct 31, 2022

Looks good to me, but @jrieken probably knows more why the span was added initially

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs the same change as the smoke test (or should be removed):

.quick-input-list .quick-input-list-rows .monaco-highlighted-label span {
opacity: 1;
}

samyarkd
samyarkd previously approved these changes Oct 31, 2022
@mjbvz mjbvz merged commit 3a8b7e4 into microsoft:main Nov 1, 2022
lemanschik pushed a commit to code-oss-dev/code that referenced this pull request Nov 25, 2022
* Highlight label should not create extra empty dom nodes

I noticed that the `HighlightedLabel` class creates extra `span` elements for text ranges. These should not be needed. Using text children directly should be faster for creation and also reduce the number of nodes in the document

I also related the conditional spread with a longer version that uses a simple call to push. This is worth doing since `HighlightedLabel` is so widely used in the editor

* Update tests

* Update smoke test selector

* Update css
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants