Hmbown/CodeWhale · error

Failed to update setting: invalid transcript spacing

Error message

Failed to update setting: invalid transcript spacing '{value}'. Expected: compact, comfortable, spacious.

What it means

The settings setter rejected the value for `transcript_spacing` (alias `spacing`). normalize_transcript_spacing must produce one of compact, comfortable, or spacious; otherwise the update fails. This keeps transcript line spacing within the three supported levels.

Solutions

  1. Use one of: compact, comfortable, spacious.
  2. Use the same vocabulary as composer_density — the two share the allowed set.
  3. Verify with normalize_transcript_spacing in settings.rs if an alias should be accepted.

Example fix

// before
settings.set("spacing", "loose")
// after
settings.set("spacing", "spacious")
Defensive patterns

Strategy: validation

Validate before calling

const SPACINGS: [&str; 3] = ["compact", "comfortable", "spacious"];
fn valid_transcript_spacing(v: &str) -> bool {
    SPACINGS.contains(&v.trim().to_ascii_lowercase().as_str())
}

Try / catch

if let Err(e) = settings.set("transcript_spacing", value) {
    eprintln!("{e}");
}

Prevention

When it happens

Trigger: Settings update with key `transcript_spacing` or `spacing` and a value outside {compact, comfortable, spacious}, e.g. `set spacing loose`.

Common situations: Using CSS-like keywords (loose, tight); typos like `comforatable`; assuming a numeric spacing value is accepted.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/41b559b907d95b16. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/settings.rs:1669

            "composer_border" | "border" => {
                self.composer_border = parse_bool(value)?;
            }
            "composer_multiline_mode" | "multiline_mode" | "multiline" => {
                self.composer_multiline_mode = parse_bool(value)?;
            }
            "composer_vim_mode" | "vim_mode" | "vim" => {
                let normalized = value.trim().to_ascii_lowercase();
                if !["vim", "normal"].contains(&normalized.as_str()) {
                    anyhow::bail!(
                        "Failed to update setting: invalid composer vim mode '{value}'. Expected: normal, vim."
                    );
                }
                self.composer_vim_mode = normalized;
            }
            "transcript_spacing" | "spacing" => {
                let normalized = normalize_transcript_spacing(value);
                if !["compact", "comfortable", "spacious"].contains(&normalized) {
                    anyhow::bail!(
                        "Failed to update setting: invalid transcript spacing '{value}'. Expected: compact, comfortable, spacious."
                    );
                }
                self.transcript_spacing = normalized.to_string();
            }
            "status_indicator" | "indicator" => {
                let normalized = normalize_status_indicator(value);
                if !["cw", "whale", "dots", "off"].contains(&normalized) {
                    anyhow::bail!(
                        "Failed to update setting: invalid status indicator '{value}'. Expected: cw, whale, dots, off."
                    );
                }
                self.status_indicator = normalized.to_string();
            }
            "synchronized_output" | "sync_output" | "sync" => {
                let normalized = normalize_synchronized_output(value);
                if !["auto", "on", "off"].contains(&normalized) {
                    anyhow::bail!(

View on GitHub (pinned to 73e0f67d83)