Simplify synth playground actions

This commit is contained in:
Meta Vens 2026-05-12 20:23:48 +01:00
commit ecd6d143bf
2 changed files with 4 additions and 6 deletions

View file

@ -103,7 +103,6 @@ public sealed class D3D12Renderer : IAquariumRenderer
private IReadOnlyList<AquariumConsoleCommand> clientCommands = [];
private string synthPlaygroundScript = AquariumSynth.Dsl.BuiltInScripts.ClassicSfxrPrimitiveGolfScripts[0].Script;
private int synthPlaygroundPreset;
private int synthPlaygroundCompileRevision;
private int synthPlaygroundPlayRevision;
private float synthPlaygroundGain = 0.45f;
private AquariumSynthPatchStatus synthPlaygroundStatus = new("aquarium-playground", AquariumSynthPatchCompileState.Idle, "idle", 0, 0.0);
@ -273,7 +272,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
synthPlaygroundScript,
AquariumSynthTrigger.Manual(synthPlaygroundPlayRevision),
synthPlaygroundGain,
synthPlaygroundCompileRevision,
0,
"aquarium_playground",
status => synthPlaygroundStatus = status);
@ -323,11 +322,10 @@ public sealed class D3D12Renderer : IAquariumRenderer
.TextBox("", TerminalDisplay, UpdateTerminalInputFromDisplay, lines: 8, acceptsReturn: false, submit: ExecuteTerminalInput, monospace: true, alignBottom: true, tooltip: "Terminal log with live command prompt.", isVisible: () => activeDebugTab == 1)
.Section("Synth Playground", () => activeDebugTab == 2)
.Options("Preset", () => synthPlaygroundPreset, SelectSynthPreset, SynthPresetOptions, "Loads a built-in synth patch.", () => activeDebugTab == 2)
.Readout("Compile", () => $"{synthPlaygroundStatus.State}: {synthPlaygroundStatus.Message}", "Faust compile status.", () => activeDebugTab == 2)
.Readout("Status", () => $"{synthPlaygroundStatus.State}: {synthPlaygroundStatus.Message}", isVisible: () => activeDebugTab == 2)
.TextBox("Patch", () => synthPlaygroundScript, value => synthPlaygroundScript = value, lines: 7, acceptsReturn: true, monospace: true, tooltip: "Patch DSL source.", isVisible: () => activeDebugTab == 2)
.Slider("Gain", () => synthPlaygroundGain, value => synthPlaygroundGain = Math.Clamp(value, 0.0f, 1.0f), 0.0f, 1.0f, "0.###", "Playground patch gain.", () => activeDebugTab == 2)
.Button("Compile", () => synthPlaygroundCompileRevision++, "Forces async Faust compile.", () => activeDebugTab == 2)
.Button("Play", () => { synthPlaygroundCompileRevision++; synthPlaygroundPlayRevision++; }, "Compiles and schedules the playground patch.", () => activeDebugTab == 2);
.Button("Play", () => synthPlaygroundPlayRevision++, "Triggers the compiled playground patch.", () => activeDebugTab == 2);
});
for (var panelIndex = 0; panelIndex < clientUi.Panels.Count; panelIndex++)
{
@ -434,7 +432,6 @@ public sealed class D3D12Renderer : IAquariumRenderer
{
synthPlaygroundPreset = Math.Clamp(index, 0, Math.Max(0, SynthPresets.Length - 1));
synthPlaygroundScript = SynthPresets[synthPlaygroundPreset].Script;
synthPlaygroundCompileRevision++;
}
public void Render(AquariumFrame frame, int width, int height)

View file

@ -71,3 +71,4 @@
{"timestamp":"2026-05-12T14:51:00+01:00","topic":"terminal-prompt-edit-boundary","lesson":"A terminal text box displays immutable log text plus a mutable prompt tail, so its editing model must clamp caret, selection, insertion, deletion, Home, and mouse placement to the prompt input region. Local text edits must clamp against the in-flight edited value, not the stale bound read value, or the first character on an empty prompt snaps the caret behind itself.","files":["src/Aquarium.Engine/Render/Ui/DebugUi.cs","src/Aquarium.Engine/Render/D3D12Renderer.cs","state/evidence.jsonl"],"source":"user terminal caret/backspace correction"}
{"timestamp":"2026-05-12T19:57:28+01:00","topic":"debug-dropdown-overlay-ownership","lesson":"Dropdown option lists are transient overlay panels, not row layout. Keep the field row's layout height constant, align the popup to the value field bounds, flip above the field when viewport space below is worse, scroll long lists inside the popup, and close the modal on outside click before other controls can react.","files":["src/Aquarium.Engine/Render/Ui/DebugUi.cs","state/evidence.jsonl"],"source":"user dropdown layout correction"}
{"timestamp":"2026-05-12T20:04:11+01:00","topic":"debug-ui-mouse-input-capture","lesson":"Renderer input capture must include both keyboard ownership and mouse ownership. If Debug UI consumes wheel or mouse interaction but the renderer only reports keyboard capture, the same wheel event leaks into client camera/runtime controls after the overlay handles it.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","state/evidence.jsonl"],"source":"user dropdown scroll capture correction"}
{"timestamp":"2026-05-12T20:20:42+01:00","topic":"synth-playground-control-authority","lesson":"The synth playground's source text owns recompilation through the synth host compile key and debounce; Play owns only manual trigger firing. Do not make Play force compilation or present compile status as an interactive control when it is only state feedback.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","state/evidence.jsonl"],"source":"user synth playground UI correction"}