Extend the display text of collapsed blocks

40 views
Skip to first unread message

Gurvan Jochum

unread,
Jun 12, 2024, 11:22:35 AMJun 12
to Blockly

Hello there,

I was wondering if there is a way to extend the display text of collapsed blocks in Blockly to show more content rather than just truncating the text. Specifically, I would like it to display more than just the block name, such as including the first input, for example.

I was reading in this discussion that it was not possible as of 2022. However, I wonder if there have been any updates or changes that make this possible now.

If it's still not easily achievable, is there a way to use the renderer to alter the appearance of the collapsed block to display more information?

Thank you in advance for your help!

Message has been deleted

Aaron Dodson

unread,
Jun 12, 2024, 6:08:18 PMJun 12
to Blockly
It seems like the situation is basically the same today unfortunately. SVG doesn't support text-overflow: ellipsis, which is why we manually truncate the text as opposed to just letting the browser reflow it to fit the available space, and the truncation length is still an internal constant. We'd certainly be open to a PR resolving that, but it would probably be good to open a discussion on the design first. One thing that may be worth looking into is using a custom tooltip to provide further information, or perhaps even an uncollapsed representation of the collapsed blocks? 

Gurvan Jochum

unread,
Jun 13, 2024, 3:56:43 AMJun 13
to Blockly

Hello,

Sorry for the re-post, I wasn't aware of how it works here.

Thank you for the answer. I see that my only way around this would be to not really collapse the collapsed block. I will look into using a tooltip as well; it might be useful in my case, but I'm not sure if that's the behavior that was requested of me.

Have a good day !

Reply all
Reply to author
Forward
0 new messages