New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solve possible issues for brands with the same name #2260
Comments
I think it's a good idea to add another field.
Just my 2 cents. I will also link #2068 because if we going to change the json we should only do it once. |
To chime in again: {
"title": "Foo Bar.js", // stays as now
"uid": "foobar-js-framework", // new, same as the filename
"hex": "FFCC60",
"althex": "99E500", // new, optional
"source": "https://en.wikipedia.org/wiki/FooBarjs", // where the logo was taken from
"web": "https://foobar.io" // actual webpage of brand, if there is one
}, |
My thoughts below, @runxel.
|
Sure! That will help will the transition, too.
I think, we should do that. But until now there weren't so many collisions. So I'd rather argue we should build that over time – thats way easier.
Noted. I'm still in favor of it :D
Oh yeah! Sorry, I wasn't explicit enough: |
Apologies for the delay 😅 @runxel I like where your suggestion is heading. Here are some comments:
|
Good feedback, as always, @ericcornelissen! (response time isn't crucial :) It's very reasonable and I think we can come to a satisfying conclusion here! |
I think that should be manageable, at least the |
Skimming through the open issues I also want to link to your very own idea, @ericcornelissen: #755 (comment) Looking back at this again, do we still want to only incorporate the |
@runxel I don't see why we would need a major release to include press kit (or similar) in the metadata. Adding a new field wouldn't break backwards compatability. Again, if you agree to using |
Cross-posting a comment from #3219 in relation to brands that share an icon but differ in colour, which we might be able to solve here:
|
Ah, but, of course, that would then create the issue of the |
After reconsidering this (the original issue) I think there are only two viable solutions:
Given the extra work required in the former solution, I'm currently tending towards the latter. |
Regarding #3219, as you pointed out, the primary problem is the |
My understanding of and suggestion for how it would work is that the slug would be optional and that we only include it when a clash with an existing icon occurs. For example, to get around #3008, the JSON would look like so:
I've used an underscore there to separate the brand name from the additional info for clarity and because it's a character we don't currently allow in filenames but that's just my suggestion, I wouldn't say it's _strictly necessary.
Through the website, as you say, and also through the README, release notes and, of course, the contributing guidelines. Ultimately, it's a (somewhat) breaking change which is something people should always be looking out for in major semver releases. All we can do is communicate the information to them in as many places as possible.
I'd say that, to prevent this from being too much of a breaking change, that we leave that as-is so that
I very much believe the title should remain faithful to the brand's actual name. But if there is a way to circumvent the clash through official variations on its name (e.g., "Sky" vs. "Sky Group") then those options should be explored before resorting to the slug. As well as that, outside official variations, I could easily see changes to the
I'd agree with that. Plus it would also cause problems for our linter. To play devil's advocate, though: if we ensured that the SVG was always assigned to the parent brand then it wouldn't be entirely inaccurate for (e.g.) the icon returned for "Sapper" having a |
Thinking about this again some more last night, one approach we could use to allow us to take this simpler approach would be to wrap the "modifier" in parentheses (e.g., "Hive Blockchain" would become "Hive (Blockchain)") and only add it to the JSON entry, allowing the SVG to use a different filename (e.g., "hive_blockchain") while retaining the correct name (e.g., "Hive") in its |
Given that the consensus seems to be to use the Personally, it seems non-optimal that Also, we need to decide on rules for the slug value. I'm personally in favor of using an underscore for this, as @PeterShaggyNoble suggested. This would avoid any potential problem where the title would map to a custom slug value. |
How would that translate to the filename, if we using underscores? Simply replacing spaces with underscores wouldn't work. |
I wasn't thinking in term of implementation yet, just in terms of usability 😅 Just replacing spaces with underscores won't work, but don't forget that we are not looking for a filename in the NPM package, see the index.js template file for reference. Currently we check if either the |
After I've reviewed all the discussion I would like to leave my opinion on how to solve this problem: I understand that this is an unique entities identification problem, as it would look from a database point of view. Essentially, using a
So I disagree with this kind of discussion. Having said that, my proposal to solve this is:
Following this, we need only to add two tests:
Complete solution (breaking change)
I'm not sure if I'm ignoring something, but I'm sure this issue needs resolution 👍 |
I'm unsure what my old position this was, but at least now I agree. Given that the filenames are already the slug anyway, I think it is fair to expect package users to relay only on the slug as well and don't support querying by title. This would, of course, be a breaking change so we can't do this until v5 - as you also mentioned. So, what I don't like is your last suggestion. I don't think it is a good idea to return different types based on the input value of the getter, I can see very few situations where this is actually beneficial, and many where this is a problem. I 100% prefer dropping support for getting with the title.
I'm not sure what you mean 🤔 What I intended to say in the part you quoted is that requiring the usage of underscores (
I can see the argument here, and would honestly be fine with it. Just keep in mind that now if we want to add some new brand "Vox DE" this would require a different slug because it's already taken by a brand named "Vox". Not the end of the world, but definitely not what I would expect.
I'm not sure if I agree, because this would require changing the slug of the existing icon, breaking backwards compatibility. One reading of this is that the second icon cannot be added until a major release. Another is that the second icon is immediately added and the existing icon slug is changed with the next major release. But at that point I don't really see a reason for changing it. For clarity, to (re)state my current position:
|
I agree with all that Eric said.
This will help with the next points. Breaking change, but a good one for 5.0.
Absolutely. I think we already agreed on a "First comes – first served" based principle. It's the easiest to handle.
Yes. Vox the tv channel should be |
But, what is the point of using a
I'm fine with this, but again, should be consistent with other slugs too, not only brand names. |
I wasn't aware of #3769 and would consider updating To be clear, the reason I suggested using
I don't know what you mean by this 😕 Of course it should be consistent with other slugs too, but also definitely with the brand name. Moreover, the line you quote doesn't say anything about the value of manual slugs, just when it should be there... |
With potentially more collision problems in light of #4797, I think we should come to a conclusion here. So, here's my take: "Unfortunately" (from my perspective) #3769 has been merged, so at least for the duration of v4.x.x releases we cannot use underscores in custom slugs to guarentee their uniqueness w.r.t. automatically generated slugs. I still believe this would be the best way to avoid collisions between "custom" and "generated" slugs as:
Provided most people/@simple-icons/maintainers agree with the above, I think we are still safe using the underscore for this - assume a collision with Pop_OS is not going to happen, and rename Pop_OS with the v5 release. We can add the following extra field to the "slug": {
"description": "The brand name as a slug (also used as file name in icons/)",
"type": "string",
"pattern": "^[a-z0-9\\-]+_[a-z0-9\\-]+$",
"required": false
} That is, allow Then, for the build scripts and tests, if the This implies that:
Considering only this issue, as has been said before, I think we should deprecate Lastly, on the website, two icons with the same title is not a problem in theory. In practice one could argue that it may be confusing that there are two entries with the same name, personally I believe that anyone looking for the icon of a specific brand will know what the icon of that brand looks like and so won't be confused by the other brand with the same name. |
Kind of issue
This issue concerns
Description
In #2205 we came to the conclusion that name clashes might become a problem in the future. As we currently use the brand name as a unique identifier for the icon and brand data we need to find a suitable solution.
One option is to add an additional field to the data file for the "official brand name" (VOX in this case) and keep "title" as the unique name/file name (VOX TV or VOX DE in this case). This would not affect anyone depending no Simple Icons and requires only minor changes on our side (make the new field optionally allowed and somehow resolve how to display both the brand name and unique filename on the website).
Any feedback on that idea or any other ideas?
The text was updated successfully, but these errors were encountered: