Ordering of plugin sub-categories in .NET 7

Thanks to multi-targeted yak packages, we will soon release the ShapeDiver plugin compiled with .NET 7 as well as Framework 4.8. So far, the testing is going well, except for a small issue.

So far, we have been using a somewhat hacky way to order the sub-categories of the plugin: as far as we can see, they can only be ordered alphabetically, and we have been using zero-width space characters to control this order, as such:

public static class SubCategoryNames
{
    public const String INPUTS =    "\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200BInputs";
    public const String OUTPUTS =   "\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200BOutputs";
    public const String DISPLAY =   "\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200BDisplay";
    public const String TEXTURES =  "\u200B\u200B\u200B\u200B\u200B\u200B\u200B\u200BTextures";
    public const String IMAGES =    "\u200B\u200B\u200B\u200B\u200B\u200B\u200BImages";
    public const String JSON =      "\u200B\u200B\u200B\u200B\u200B\u200BJSON";
    public const String ANIMATION = "\u200B\u200B\u200B\u200BAnimations";
    public const String SHAPEWAYS = "\u200B\u200B\u200BShapeways";
    public const String EXTRA =     "\u200B\u200BExtra";
    public const String APPBUILDER = "\u200BApp Builder";
}

This still works fine in .NET Framework but the .NET 7 version seems to ignore the zero-width spaces, which messes up the order of categories as we defined them.

Is there a better way to order sub-categories? If not, could this issue be looked at?

Does anyone have an idea about this?

Do any other whitespace characters work (i.e tabs)? Does an actual space not work hence the explicit \u200B?

We should just fix this. I remember another report of this hack not working in 8. I’m out at the moment, but will create a bug report for this when I get home.

Added to YT at https://mcneel.myjetbrains.com/youtrack/issue/RH-83156/Apply-custom-string-sorting-for-subcategories

3 Likes

I just merged new code into 8.x which has new sorting behaviour. Sometime today or tomorrow we should have an internal build with that change. Do you want the installer to test this @mathieu1 ?

1 Like

Thanks @DavidRutten, I’m happy to test this change already if you can provide an installer, but this is not time sensitive so it can wait until an official release as well.

1 Like