Ensure single row display for text visualizer #1470
Merged
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.
This PR ensures the default text visualizer always displays a single row for every element in a sequence, even if the string representation of the object includes line break characters. This is important to ensure the correctness of the visualizer behavior: expanding the height of the visualizer window directly controls how many values are buffered on the display by using multiples of the rendered line height.
If arbitrary multi-line text is left to render unfiltered, this calculation has the potential to be thrown off in a very misleading way, as expanding the control to see all the lines will have the effect of expanding the buffer. Since in this case a single value would already fill up multiple lines, and new values are shown at the bottom, this would mean that the value at the top would be a value in the past, rather than the most recent.
As it currently stands, it is best to assume that no line breaks are allowed. Future versions of the text visualizer, or other visualizers, may introduce other options for multi-line text but for now we want to ensure predictability over flexibility.