generalize convert-to-mp3 into convert-audio with selectable target format

- rename task to convert-audio, support mp3/flac/wav/ogg/aac/opus targets
- add options input type with selectable pill buttons in UI
- extend seed script parser to handle YAML list properties (options)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 16:42:44 +00:00
co-authored by Claude Opus 4.6
parent 729ffb930b
commit 2caccc183c
4 changed files with 91 additions and 14 deletions
@@ -198,6 +198,7 @@ type TaskInputDef = {
type: string;
description?: string;
default?: string;
options?: string[];
};
type TaskInputFormProps = {
@@ -239,6 +240,26 @@ const TaskInputForm = ({ inputDefs, values, onChange, autoFilledKeys }: TaskInpu
);
}
if (def.options && def.options.length > 0) {
const selected = values[key] ?? def.default ?? def.options[0]!;
return (
<div key={key} className="flex flex-col gap-1.5">
<span className="text-sm font-medium text-duck-dark dark:text-foreground">{def.description ?? key}</span>
<div className="flex flex-wrap gap-1.5">
{def.options.map((opt) => (
<button
key={opt}
onClick={() => onChange(key, opt)}
className={`px-3 py-1 text-xs font-medium rounded-md transition-colors cursor-pointer ${selected === opt ? 'bg-duck-teal text-white' : 'bg-duck-dark/5 dark:bg-foreground/5 text-duck-dark/60 dark:text-foreground/60 hover:text-duck-dark dark:hover:text-foreground hover:bg-duck-dark/10 dark:hover:bg-foreground/10'}`}
>
{opt}
</button>
))}
</div>
</div>
);
}
// Default: text input for string/number
return (
<div key={key} className="flex flex-col gap-1">