yaqwsx / jlcparts

Better parametric search for components available for JLC PCB assembly
https://yaqwsx.github.io/jlcparts/
MIT License
561 stars 51 forks source link

Propertiy names should be cAsE inDEpenDeNT #86

Closed ADonut closed 12 months ago

ADonut commented 1 year ago

'package' and 'Package' are different properties. This clutters the UI. Property names should be normalized and merged.

FWIW, capitalizing the first word only, 'Number of channels', seems to use less pixels than capitalizing every word, 'Number Of Channels'.

This will backfire on property names that need a particular capitalization, 'MHz' -> 'Mhz', 'MOQ' -> 'Moq'

DeflateAwning commented 12 months ago

In the codebase, there's a funny comment that cautions against normalizing category names.

def normalizeCategoryName(catname):
    return catname
    # If you want to normalize category names, don't; you will break LCSC links!
    # return catname.replace("?", "")

I still want to take a stab at this, but it may require some semi-major reworking as it appears that the category names are strongly linked to some URLs or similar.

yaqwsx commented 12 months ago

Coincidently, I implemented 9402f0747e5611e4a70380abaa5a4ea9557c0163 yesterday, so the problem should be gone.

@DeflateAwning: The solution is straightforward; a category should also have a parameter for URL prefix. However, given how messy the data from JLC PCB are, I don't see a huge benefit in simplifying five or six category names. But feel free to open a PR for that.

The original issue is resolved, closing.