View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0018449 | MMW 5 | Extensions framework | public | 2021-10-21 15:22 | 2024-07-07 12:22 |
Reporter | drakinite | Assigned To | |||
Priority | urgent | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | reopened | ||
Product Version | 5.0.2 | ||||
Target Version | 5.0.2 | Fixed in Version | 5.0.2 | ||
Summary | 0018449: Enable skin options via info.json so skin developers don't have to write code | ||||
Description | As most skin designers are not developers, it does not make much sense to force them to write code in order to make their skins configurable. We should add the option to generate configuration panels from a "skin_options" attribute in their info.json. Should carry an array with each configurable attribute. Example JSON: { "skin_options": [ { "type": "color", "title": "Text color", "variable": "@textColor", "default": "#ffffff" }, { "type": "color", "title": "Highlight color", "variable": "warningColor", "default": "white" }, { "type": "dropdown", "title": "Font size", "variable": "@baseFontSize", "default": "11", "options": [ "9", "11", "13" ] }, { "type": "dropdown", "title": "Font size (2nd example)", "variable": "@baseFontSize", "default": "11", "options": { "9": "Small", "11": "Medium", "13": "Large" } }, { "type": "radio", "default": "compactEnabled", "title": "Compact mode", "options": { "compactEnabled": { "title": "Enable Compact Mode", "variables": { "baseFontSize": "12px", "waveformHeight": "24px", "baseIconSize": "22px" } }, "compactDisabled": { "title": "Disable Compact Mode", "variables": { "baseFontSize": null, "waveformHeight": null, "baseIconSize": null } } } } ] } | ||||
Tags | No tags attached. | ||||
Fixed in build | 2517 | ||||
related to | 0017880 | closed | drakinite | Addons (external) | Material Design Compact: Add compact mode in a setting accessible in the View submenu |
related to | 0018483 | closed | drakinite | MMW 5 | Add Skin Options shortcut in View menu |
related to | 0018506 | closed | drakinite | MMW 5 | Skin string tweaks |
related to | 0021064 | feedback | petr | MMW 5 | New types of skin_options needed (checkbox, number edit box) |
related to | 0021066 | closed | drakinite | MMW 5 | Incorrect value stored in persistent.json for skin option |
|
Note: When writing documentation on this feature, we/I need to explain how to rectify a crash in the case of an invalid LESS variable. 1) either delete persistent.json or delete the problematic string inside the customLESS.values array 2) delete the problematic precompiledLESS file in the temp directory |
|
Added feature in 2512, along with: - Improved app load time. - Changed Monkey Groove to have an automatic config panel instead of a config.html and config.js. Same commit as in 0017880. |
|
Feedback from TIV73 (https://www.mediamonkey.com/forum/viewtopic.php?f=27&t=100488): 1) Skins with info.json config panels should show up in the "configurable" addons section. Clicking the gear should open the skin config panel through the same method as 0018483 2) "Modified options are persisted as n_[type] (like 3_color, 2_radio, etc.) in persistent.json, which could lead to inconsistent values if the order of elements is changed after their value has been set. I wanted to highlight it since it happened to me when I set up the options, and it could lead to issues and inconsistend behavior down the road if addon authors change the layout customization settings in future updates." 3) "I would love to see an option to either pick up the default values directly from a less file, or make it possible to remove a stored value if the user clicks the reset changes button instead of assigning a static default value. Consider the following use case: A user tries out different skin color settings, but decides that they ultimately like the default value best, so they click the reset changes button. Some time later, the addon author finds out that the default value is hard to read in some places and pushes an update that changes the default in the their info.js and less files. The user installs the update, but since the reset changes button sets a static value instead of removing the option alltogether they will not get the new default." Currently unsure how best to implement 2; requesting feedback from TIV73. |
|
Fixed in 2517. 1) Autogenerated config panels now show up in the same place as regular config panels, and open on app install. 2) Options are now saved according to the following pattern: For radio: radio_(formatted version of title), e.g. for CodeMonkey: radio_active_tab_background For all others: (type)_(variable), e.g. for Monkey Groove: color_@warningColor 3) Saving skin options now "flushes" old customLESS values (New, optional third parameter to setLessValues) |
|
Verified 2528 no issues found. |
|
"radio_(formatted version of title)" is not very good way to store options of radio buttons, for the similar reason mentioned in 2). What if I change the title in the updated version of skin? "(type)_(variable)" format is fine, but it cannot be implemented on radio, because you made it in such way that one radio option could change several Less variables. Which is fine sometimes, but why not having the same for dropdowns as well? Maybe it could be useful for some skins if each option in a dropdown could change multiple Less variables. However, I have another thing on my mind. What if I have a radio group that change only one value? In such case, the radio group could be treated similarly to the current implementation of dropdown and we could have something like this: { "type": "radio", "title": "Album Artwork", "variable": "@albumArtwork", "default": "2", "options": { "1": "Hide", "2": "Show if exists", "3": "Show always" } } In that case, the persistent.json will have stored the values for radios using a Less variable name, independently of their titles. And you could keep the existing syntax for cases when some skin needs to change multiple variables with each radio option. |