inspector
inspector copied to clipboard
Update string truncation behavior
This should look visually similar, but selecting and copying a truncated string will now copy the entire string (excluding the “…”), even the portion that is not visible.
I have also changed the ellipsis from the standard ellipsis character (…), which can easily be missed, to a more obvious ••• rendered in black so it is clearly not part of the string.
Would it be possible to get this merged? It annoys me that it’s really hard to copy out long strings from notebooks.
I believe the ellipsis is not only a visual aid for long strings, but also avoids rendering excessively large strings in the DOM. Under that premise you'd have to pick a different strategy. Some suggestions:
- replace the ellipsis with its masked content on click
- allow truncated strings to be expanded (like we do for arrays and objects), revealing the entire string line-wrapped
- detect copy events, determine whether the ellipsis text node is in the selection range, and replace it with the actual content
- add an explicit copy button (e.g. on hover)