From 406d16d9d0cb00c8ad593554e9abb281bfd1b67f Mon Sep 17 00:00:00 2001 From: Cooper Maruyama Date: Sun, 24 May 2026 22:12:12 -0700 Subject: [PATCH 1/2] feat(native): auto-generated UI for Configurable settings via inventory registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding a new field to a Configurable struct now automatically appears in the Tuning section of the Developer settings tab — no frontend changes required. Schema metadata (label, type, range, defaults, help text) is emitted by the derive and consumed by a generic React component. How it works: 1. The configurable runtime crate gains schema types (ConfigurableSchema, ConfigField, FieldType, EnumVariant) that flow to TS via specta. A type-erased RegisteredConfig holds fn pointers per struct; the derive submits one to a global inventory at compile time. 2. The derive parses an expanded attribute grammar: #[config( store_path_fn = ..., display_name = "Evolution", description = "...", )] pub struct EvolutionLimits { #[config( default = 25, key = "maxIterations", label = "Max iterations", range = 1..=200, help = "API calls before stopping", )] pub max_iterations: usize, } FieldType is inferred from the Rust type: numeric primitives become Number{min,max}, bool becomes Boolean, String becomes String{multiline}. Any field annotated with #[config(options = ["a", "b"])] becomes an Enum regardless of its Rust type — labels are humanized from the variant values. 3. Each struct's derive generates: - load(app) — read all fields with defaults - schema(app) — full schema + current values - set_field(app, k, v) — type-checked single-field write - Wry-monomorphic shims for the fn pointers in RegisteredConfig 4. Two Tauri commands wrap the registry: - dev_configs_list — walks inventory, returns Vec - dev_config_set — dispatches by struct name to set_field 5. renders the right control per FieldType.kind: number → , boolean → , string → (or