{"record":{"id":"7cef68eaa679d975","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-invalid-work-surface-placement","errorCode":null,"errorMessage":"Failed to update setting: invalid work surface placement '{value}'. Expected: top, bottom, left, right, or off.","messagePattern":"Failed to update setting: invalid work surface placement '(.+?)'\\. Expected: top, bottom, left, right, or off\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1536,"sourceCode":"            \"fancy_animations\" | \"fancy\" | \"animations\" => {\n                self.fancy_animations = parse_bool(value)?;\n            }\n            \"focus_texture\" | \"texture\" => {\n                let normalized = value.trim().to_ascii_lowercase();\n                if !matches!(normalized.as_str(), \"off\" | \"scrim\" | \"grain\") {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid focus texture '{value}'. Expected: off, scrim, or grain.\"\n                    );\n                }\n                self.focus_texture = normalized;\n            }\n            \"work_surface_placement\" | \"work_surface\" | \"work_rail\" => {\n                let normalized = value.trim().to_ascii_lowercase();\n                if !matches!(\n                    normalized.as_str(),\n                    \"top\" | \"bottom\" | \"left\" | \"right\" | \"off\"\n                ) {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid work surface placement '{value}'. Expected: top, bottom, left, right, or off.\"\n                    );\n                }\n                self.work_surface_placement = normalized;\n            }\n            \"rail_panel\" | \"rail\" => {\n                let normalized = value.trim().to_ascii_lowercase();\n                // `pinned` stays accepted as a setting word; it folds into\n                // the tasks view exactly like the load-time migration.\n                if !matches!(\n                    normalized.as_str(),\n                    \"tasks\"\n                        | \"agents\"\n                        | \"background\"\n                        | \"files\"\n                        | \"notepad\"\n                        | \"context\"\n                        | \"git\"","sourceCodeStart":1518,"sourceCodeEnd":1554,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L1518-L1554","documentation":"The settings setter rejected the value given for `work_surface_placement`. Accepted values are top, bottom, left, right, or off (case-insensitive, trimmed). The guard prevents an invalid rail placement from corrupting the layout config.","triggerScenarios":"Settings update with key `work_surface_placement` (aliases `work_surface`, `work_rail`) and a value outside {top, bottom, left, right, off}, e.g. `set work_rail floating`.","commonSituations":"Typing a placement keyword from another tool; assuming diagonal or auto placements exist; typo like `bottom-right`.","solutions":["Use one of: top, bottom, left, right, or off.","Use `off` to hide the work surface rail instead of an invented keyword.","Verify the alias you used resolves to work_surface_placement in settings.rs."],"exampleFix":"// before\nsettings.set(\"work_surface_placement\", \"floating\")\n// after\nsettings.set(\"work_surface_placement\", \"left\")","handlingStrategy":"validation","validationCode":"const PLACEMENTS: [&str; 5] = [\"top\", \"bottom\", \"left\", \"right\", \"off\"];\nfn valid_work_surface_placement(v: &str) -> bool {\n    PLACEMENTS.contains(&v.trim().to_ascii_lowercase().as_str())\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = settings.set(\"work_surface_placement\", value) {\n    eprintln!(\"{e}\"); // message lists all accepted placements\n}","preventionTips":["Use the exact keywords top/bottom/left/right/off.","Present placements as a fixed choice list in tooling, not free text.","Use `off` to disable rather than inventing a hidden value."],"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"}