jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.51k stars 745 forks source link

Solution for long sprite's names in sprite corral. Truncate the left side (for example: 'experiment1' to '...ment1'); and a tooltip showing full name #2187

Open DyslexicAwe opened 6 years ago

DyslexicAwe commented 6 years ago

Longer sprite's names get truncated, for example, a sprite's name "experiment" gets truncated to "experime".

sprite corral items width

brianharvey commented 6 years ago

Jens will ask what he's supposed to do about it; we really don't want expandable buttons, which would uglify the sprite corral.

But I suggest that if a name is truncated, it should be the beginning that's lost, not the end, because of common naming conventions like "experiment2", "experiment3", etc.

Naharie commented 6 years ago

@brianharvey How about ending with "...", and then showing the full name in a tooltip when you hover over the icon. In other words the icon would show "experi...", but the tooltip would show "experiment".

brianharvey commented 6 years ago

@KingDavid12 The tooltip is a good idea, but I'd still want to truncate at the left instead of at the right.

Naharie commented 6 years ago

@brianharvey I didn't mean to say that it shouldn't truncate at the left, just that whichever side is truncated has the dots, since they are an almost universal sign that the text has been truncated.

brianharvey commented 6 years ago

Got it! :-)

DyslexicAwe commented 6 years ago

Together you really found the solution I could really only hope for. You are the best, @brianharvey and @KingDavid12 Hopefully Jens will like it so much, too, to PR it.

DyslexicAwe commented 5 years ago

@jmoenig asking for the 'Blessed by Jens' tag :)

bromagosa commented 5 years ago

Wouldn't it be best to have the ellipsis be in the middle of the name?

Like expe...ent1, expe...ent2.

DyslexicAwe commented 5 years ago

Since a sprite'name's (maximum) visible length is 8 characters, this is how it looks like with ellipsis in the middle. (It makes no difference if true ellipsis '…' is used, or three dots are used '...'). ex…ent1

brianharvey commented 5 years ago

As long as there's room for, say, three digits.

The underlying point here is that the sprite's picture gives you a good clue as to what kind of sprite it is (the first part of the name), but the picture doesn't help at all with which one of that kind it is. Thus it's more important to have the number part than the name part.

Some time I really would like to revisit the parentheses in the names. "Sprite (2)" wastes three precious characters.

DyslexicAwe commented 5 years ago

Having read your explanation above, here we have the previous title again :)