Support extra_data on dynamically-added plugins#212
Open
sastraxi wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A plugin added from the mod-ui web UI mid-session was missing
extra_data, so NAM tiles show a generic name instead of the model, and the Notes panel opens blank. Boards loaded from disk are unaffected —hydratehas the instance number and reads the TTL.Mechanism
plugins.customization.lookuppopulatesextra_databy reading{bundlepath}/effect-{instance_number}/effect.ttl.Pedalboard._build_plugin(theaddWS path) has neither the bundle nor the number, so it calls the customizer with defaults and the parser never runs.Fix: consume patch_set
mod-ui already broadcasts what the TTL parsers are digging for:
... whenever a writable property changes, and it also replays every stored property on the connect dump. The
paramuris are the same ones_MODEL_REand_NOTES_REmatch in the TTL —…neural-amp-modeler-lv2#model,…notes#text— because that is how patch properties serialize intoeffect-N/effect.ttlin the first place.The fix is to respond to these extra fields:
ws_protocol.py— add aPatchSetMessage(instance, param_uri, value_type, value)caseplugins/customization.py— add a second registration hook alongsideextra_data_fn, keyed by property URI, that buildsPluginExtraDatafrom a live value rather than TTL text.modhandler.py— onPatchSetMessage, resolve the plugin, rebuild itscustomization.extra_data, then repaint.This covers the case the TTL never can: a freshly added plugin has no
effect-Ndirectory at all until the board is saved. It also makes extra_data track mid-session changes — swap the NAM model in the browser and the tile follows.Bonus: the Notes TTL regex
_NOTES_RErequired"""triple quotes""". Turtle only long-quotes when the text needs it, so any single-line note serialized as"Abc123"and silently failed to parse — blank panel, no pencil, on the loaded-board path where extra_data was supposed to work. Fixed alongside; unrelated to the dynamic-add gap above.