Skip to content

Optimise and improve label icons#398

Open
BenjaminSchaaf wants to merge 1 commit into
packagecontrol:gh-pagesfrom
sublimehq:label-opt
Open

Optimise and improve label icons#398
BenjaminSchaaf wants to merge 1 commit into
packagecontrol:gh-pagesfrom
sublimehq:label-opt

Conversation

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor

This makes the following changes to improve/optimise labels:

Label icons with one usage are not included, saving 85KB compressed. These labels are already excluded from the label list, so there's not much point having the icon.

Excluded some label icons that are just the label in a fancy color. Having the label for C++ read as "C++ C++" just doesn't look good.

Deduplicated labels based on capitalization. "C" and "c" should not be different labels.

@kaste

kaste commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

I cherry-pick "Dedup labels" straight. Note however, that its implementation needs an improvement as you just implemented "the first casing wins". And we're lucky with "c" and "c++", but not so with e.g. "sublimelinter" and "SublimeLinter". I think a "most used spelling/form wins" is a good heuristic and still dynamic.

Label icons with one usage are not included, saving 85KB compressed. These labels are already excluded from the label list, so there's not much point having the icon.

That's the wrong claim, we have them everywhere:

image image image

I do agree that the three c-family icons look redundant. At that time, I actually also thought about omitting the text part and to keep just the icon. Another way is of course to just get better icons for these three.

I do like, or rather would like, because we're not there yet, if all languages had their own icons. E.g.

image vs image

I miss them. If I focus on their specific look, I hate them.

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor Author

That's the wrong claim, we have them everywhere

I meant the overall list of labels.

It's only a single package that has each of those labels, I don't think it's worth downloading 85KB for individual packages.

@kaste kaste mentioned this pull request Jun 11, 2026
@kaste

kaste commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

I meant the overall list of labels.

The first screenshot I posted is from the labels page.

I don't think it's worth downloading 85KB for individual packages

The current download size is 85kB total; your 85kB refer the uncompressed diff. The savings are roughly 37kib.

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor Author

The first screenshot I posted is from the labels page.

The screenshot is from the search, not from the overall list of labels.

The current download size is 85kB total; your 85kB refer the uncompressed diff. The savings are roughly 37kib.

Hmm, could've sworn I checked the gzipped size, but I clearly didn't. Still don't think that's a price worth paying for the label icons; we're considering removing the icons all-together for the official site.

@kaste

kaste commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

overall list of labels

initial load, yes sure. But the "Omitting labels ..." changes and is clickable as well.

we're considering removing the icons all-together

I don't get the size thing at all (if it's not huge). Either you have icons or not, and then: if you load them eager you always "overload", and if you load them lazy it looks shit or is a bit non-trivial to implement.

I can relate to "none at all" much more. Personally, I was never a fan, I just implemented it. So -- so sorry I forgot the name of the original Sublime Text author -- if he chimes in and leaves a vote, we had 3 against 2.

--

For the C family, omitting the text and just showing the icon, looks like this

image

which is an improvement if we keep the icons.

--

I didn't go through the icons actually, but maybe we could just drop all non-language icons; e.g. I saw "audio" but we're a programming community.

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor Author

initial load, yes sure. But the "Omitting labels ..." changes and is clickable as well.

Interesting, it does not look clickable haha

For the C family, omitting the text and just showing the icon, looks like this
which is an improvement if we keep the icons.

I disagree, the C++ icon is hard to read as text but still looks awful next to C++ as text. Having only the icons also makes it invisible to native search.

So -- so sorry I forgot the name of the original Sublime Text author -- if he chimes in and leaves a vote, we had 3 against 2.

Fwiw it was Jon's idea to remove the icons entirely after I showed him the C/C++ ones.

They also aren't included in the list of labels, so no reason to bloat
the icons for insignificant labels.

Additionally, this improves exclusions and aliases of icons. C, C# and
C++ icons look very silly next to their names, so exclude those.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants