View Issue Details

IDProjectCategoryView StatusLast Update
0021066MMW 5Skinning frameworkpublic2024-08-09 11:41
Reporterzvezdan Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.1 
Target Version5.1Fixed in Version5.1 
Summary0021066: Incorrect value stored in persistent.json for skin option
DescriptionLet say that I have a skin with the next info.json:
{
    "title": "Info Test",
    "id": "infoTest",
    "description": "Info Test",
    "version": "1.0.0",
    "type": "skin",
    "author": "Zvezdan Dimitrijevic",
    "skin_options": [
        {
            "type": "dropdown",
            "title": "Font size",
            "variable": "@testVariable",
            "default": "2",
            "options": {
                "1": "something (red)",
                "2": "anything (blue)",
                "3": "dropdown (green)"
            }
        }
    ]
}

An let say that I have skin_base_add.less:
@testVariable: 2;

body {
    & when (@testVariable = 1) {
        background: red !important;
    }
    & when (@testVariable = 2) {
        background: blue !important;
    }
    & when (@testVariable = 3) {
        background: green !important;
    }
}

If I change dropdown from the default 2-nd value to the 1-st one, I will get the next lines in the persistent.json:
    "infoTest_skinOptions": {
        "dropdown_@testVariable": "1"
    },

    "CustomLESS_infoTest": {
        "values": [
            "@testVariable: 1px;"
        ]
    },

Note the added "px".

It seems that the program works fine with such skin even with this anomaly, but it is quite strange because (@testVariable = 1px) is not the same as (@testVariable = 1).
TagsNo tags attached.
Attached Files
infoTest.mmip (656 bytes)
Fixed in build3037

Relationships

related to 0018449 closeddrakinite Enable skin options via info.json so skin developers don't have to write code 

Activities

michal

2024-07-11 15:42

developer   ~0076264

Yes, I think it makes sense.

michal

2024-07-15 07:16

developer   ~0076283

Fyi. Material Colors skin needs related fix - @baseFontSize is set without "px", which causes invisible text. Maybe we could leave automatic adding of "px" to known px variables, like @baseFontSize in this case.

michal

2024-07-15 07:43

developer   ~0076284

Added to build 3037. Fixed for @baseFontSize, as it is probably most used and needed.

michal

2024-08-09 11:41

developer   ~0076623

Tested all skins and they seem to work, resolving.