-
Notifications
You must be signed in to change notification settings - Fork 24
Add Dynamic Parameter Rendering #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
08ff0f2 to
f805f4c
Compare
yondonfu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good! I tested install of the sample plugin and confirmed that the schema driven fields show up in InputAndControls + Settings panel and that updating the fields in the former trigger parameter update sends across the WebRTC data channel during runtime.
There seems to be a stray box by default when I open up the app and look at the default LongLive settings.
| (str | None); the UI renders an image picker like first_frame_image. | ||
| Omit for primitive widgets. | ||
| modes: Restrict to input modes, e.g. ["video"]. Omit to show in all modes. | ||
| is_load_param: If True, this field is a load param (passed when loading the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this belong here? The distinction between runtime vs. load params seems like a data level distinction as opposed to a UI level distinction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide if the UI elements are disabled when the stream is active. E.g. you cannot modify height/width when the stream is ongoing.
Some other options:
- Rename to
enabled_when_stream_activeor something similar to clarify the intention - Do not allow load params at all to define by plugins. So, all plugin-defined UI elements are always active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right that's why the UI needs to know if it is a load param. I'm wondering if it makes sense to just make that distinction outside of json_extra_schema since this is just being used for UI logic and whether something is a load vs runtime param affects whether it should be passed in the pipeline init or the call which is not just a UI concern. The immediate thought is having some way to mark a field as runtime vs load eg separate load/runtime config. I don't have a strong pref here so just making a note. If you think this can be considered separately no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s keep things as they are for now.
I agree that the backend could eventually use is_load_param to decide whether params should be passed to __init__() or __call__(). However, at this stage, I think the simplest and safest approach is to pass all params to both.
The main reason I don’t want to introduce that separation yet is that some params will likely apply to both cases, which requires more careful design. For now, filtering this in the UI feels like the best and least complex solution.
Signed-off-by: Rafal Leszko <rafal@livepeer.org>
f805f4c to
c9fb517
Compare
4f33260 to
901fa07
Compare
yondonfu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't need to happen immediately, but for my own understanding will we be able to slim down BasePipelineConfig too? It seems to have a lot of stuff.
| </div> | ||
|
|
||
| {/* Schema-driven input fields (category "input"), below app-defined sections */} | ||
| {configSchema && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we be able to in a separate PR remove the app-defined sections if this is here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's maybe do it in separate refactoring PR, try to convert every part of the Input & Settings section into Complex Components. For now, it's ok, these code should be applied to each pipeline (though it may be hidden for some), so it's mainly about refactoring it into Complex Components.
Yes, agree. The same actually with some parts of the frontend, like |
Signed-off-by: Rafal Leszko <rafal@livepeer.org>
65270d8 to
5964d39
Compare


Add support for defining parts of the frontend in plugins.
Demo
demo_dynamic.mp4
Sample plugin
It's simplest to understand how it works by looking at a sample plugin: https://github.com/leszko/scope-plugin-ui
DAYDREAM_SCOPE_PREVIEW=1 uv run daydream-scope install git+https://github.com/leszko/scope-plugin-uiWhat and how to define
Any field in
schema.pythat includesjson_schema_extrawill be rendered in the UI.You can define the following keys inside
json_schema_extrato control how the field is displayed:order(int) — Controls the rendering order in the UI (lower numbers appear first).category(str) — Determines where the field is displayed. Possible values:inputconfiguration(default)component(str) — The name of a custom or complex UI component to use for this field.label(str) — The label shown in the UI. If not provided, the field’sdescriptionis used.modes(list[str]) — Specifies which modes the field is visible in.Defaults to
["text", "video"].Resources:
Non-Goals