{"record":{"id":"a5201c6061e58292","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-invalid-composer-density","errorCode":null,"errorMessage":"Failed to update setting: invalid composer density '{value}'. Expected: compact, comfortable, spacious.","messagePattern":"Failed to update setting: invalid composer density '(.+?)'\\. Expected: compact, comfortable, spacious\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1645,"sourceCode":"            \"locale\" | \"language\" => {\n                let Some(locale) = normalize_configured_locale(value) else {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid locale '{value}'. Expected: {}.\",\n                        codewhale_localization::configured_locale_values(\", \")\n                    );\n                };\n                self.locale = locale.to_string();\n            }\n            \"theme\" | \"ui_theme\" => {\n                self.theme = normalize_theme_setting(value).map_err(anyhow::Error::msg)?;\n            }\n            \"background_color\" | \"background\" | \"bg\" => {\n                self.background_color = normalize_background_color_setting(value)?;\n            }\n            \"composer_density\" | \"composer\" => {\n                let normalized = normalize_composer_density(value);\n                if ![\"compact\", \"comfortable\", \"spacious\"].contains(&normalized) {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid composer density '{value}'. Expected: compact, comfortable, spacious.\"\n                    );\n                }\n                self.composer_density = normalized.to_string();\n            }\n            \"composer_border\" | \"border\" => {\n                self.composer_border = parse_bool(value)?;\n            }\n            \"composer_multiline_mode\" | \"multiline_mode\" | \"multiline\" => {\n                self.composer_multiline_mode = parse_bool(value)?;\n            }\n            \"composer_vim_mode\" | \"vim_mode\" | \"vim\" => {\n                let normalized = value.trim().to_ascii_lowercase();\n                if ![\"vim\", \"normal\"].contains(&normalized.as_str()) {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid composer vim mode '{value}'. Expected: normal, vim.\"\n                    );\n                }","sourceCodeStart":1627,"sourceCodeEnd":1663,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L1627-L1663","documentation":"The settings setter rejected the value for `composer_density` (alias `composer`). normalize_composer_density must return one of compact, comfortable, or spacious; anything else is rejected. This keeps the composer's visual density within the three supported levels.","triggerScenarios":"Settings update with key `composer_density` or `composer` and a value outside {compact, comfortable, spacious}, e.g. `set composer cozy`.","commonSituations":"Inventing a fourth density level; typos like `comfotable`; copying density names from editors (VS Code uses similar terms but not identical).","solutions":["Use one of: compact, comfortable, spacious.","Check the spelling; normalization handles case but not typos.","Inspect normalize_composer_density in settings.rs to see exactly what aliases collapse to these three values."],"exampleFix":"// before\nsettings.set(\"composer_density\", \"cozy\")\n// after\nsettings.set(\"composer_density\", \"comfortable\")","handlingStrategy":"validation","validationCode":"const DENSITIES: [&str; 3] = [\"compact\", \"comfortable\", \"spacious\"];\nfn valid_composer_density(v: &str) -> bool {\n    DENSITIES.contains(&v.trim().to_ascii_lowercase().as_str())\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = settings.set(\"composer_density\", value) {\n    eprintln!(\"{e}\");\n}","preventionTips":["Only the three density keywords exist; do not invent levels.","Reuse the same density constant as transcript_spacing.","Fix typos like `comfotable`; case is normalized but spelling is not."],"tags":["config","validation","tui"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}