Repository navigation
ScripTree v0.1.6 — RadioWidget
ScripTree v0.1.6 — RadioWidget
Third of four small releases. v0.1.4 added env vars, v0.1.5 added the per-param no_split opt-out; this one ships a real radio-button widget for enum params.
What's new
Widget.ENUM_RADIO (already in the schema since day one) is now backed by a real RadioWidget instead of falling back to a dropdown. Use it for enum params with a small set of options where visibility matters more than compactness:
{
"id": "mode",
"type": "enum",
"widget": "enum_radio",
"default": "fast",
"choices": ["fast", "thorough", "exhaustive"],
"choice_labels": ["Fast (5s)", "Thorough (30s)", "Exhaustive (5m)"]
}UI: a vertical stack of mutually-exclusive radio buttons, same selection semantics as a dropdown — get_value() returns the raw value (e.g. "fast"), labels are cosmetic.
"(none)" option
A choice with an empty value ("") plus a friendly label gives you a "no-op" option that emits nothing:
{
"id": "verbosity",
"type": "enum",
"widget": "enum_radio",
"default": "",
"choices": ["", "-v", "-vv", "-vvv"],
"choice_labels": ["(none)", "Quiet", "Verbose", "Debug"]
}Selecting (none) makes {verbosity} substitute as "", which drops the whole template token (or its enclosing token group) via the existing empty-substitution rule. Argv with template = ["{verbosity}", "file.txt"]:
| Selection | argv |
|---|---|
(none) |
["tool", "file.txt"] |
Quiet |
["tool", "-v", "file.txt"] |
Debug |
["tool", "-vvv", "file.txt"] |
No new mechanism — the drop-on-empty rule has always applied to substitutions; it just composes nicely with radio buttons.
Implementation
- New
RadioWidget(ParamWidget)inscriptree/ui/widgets/param_widgets.py. UsesQButtonGroupwithsetExclusive(True)for mutual exclusion. - Each
QRadioButtonstores its raw value as a Qt user property; visible label comes fromparam.label_for_choice(value). set_value(None)clears all selections (flips exclusive off → unchecks all → flips back on — Qt requires this dance).- Dispatch in
build_widget_for()updated from the placeholderWidgetKind.ENUM_RADIO: DropdownWidgetto the realRadioWidget.
Documentation
help/LLM/param_types_widgets.md gains an enum_radio subsection with the (none) example and the argv table.
Download
ScripTree-v0.1.6-windows-x64.zip — portable folder with vendored PySide6 pre-trimmed. Extract and double-click run_scriptree.bat. Requires Python 3.11+ on the host.