{"record":{"id":"6a2cfd0bb5f1fe0b","repo":"BigPizzaV3/CodexPlusPlus","slug":"theme-json-art-6a2cfd","errorCode":null,"errorMessage":"theme.json.art 枚举值无效","messagePattern":"theme\\.json\\.art 枚举值无效","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":1306,"sourceCode":"    for key in [\"focusX\", \"focusY\"] {\n        if object.get(key).is_some_and(|value| {\n            value\n                .as_f64()\n                .is_none_or(|number| !number.is_finite() || !(0.0..=1.0).contains(&number))\n        }) {\n            bail!(\"theme.json.art.{key} 无效\");\n        }\n    }\n    if object.get(\"safeArea\").is_some_and(|value| {\n        value\n            .as_str()\n            .is_none_or(|value| !matches!(value, \"left\" | \"right\" | \"none\"))\n    }) || object.get(\"taskMode\").is_some_and(|value| {\n        value\n            .as_str()\n            .is_none_or(|value| !matches!(value, \"ambient\" | \"full\" | \"off\"))\n    }) {\n        bail!(\"theme.json.art 枚举值无效\");\n    }\n    Ok(())\n}\n\nfn valid_theme_color(value: &str) -> bool {\n    if let Some(hex) = value.strip_prefix('#') {\n        return matches!(hex.len(), 3 | 4 | 6 | 8)\n            && hex.bytes().all(|byte| byte.is_ascii_hexdigit());\n    }\n    if value.starts_with(\"rgb(\") && value.ends_with(')') {\n        let values = &value[4..value.len() - 1];\n        return split_top_level(values, ',').is_some_and(|values| {\n            values.len() == 3\n                && values.into_iter().all(|value| {\n                    let value = value.trim();\n                    !value.is_empty()\n                        && value.len() <= 3\n                        && value.bytes().all(|byte| byte.is_ascii_digit())","sourceCodeStart":1288,"sourceCodeEnd":1324,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L1288-L1324","documentation":"Thrown by validate_theme_art when optional safeArea is not one of left/right/none or taskMode is not one of its allowed enum strings. The offending input is theme.json.art.safeArea or .taskMode — enum-valued display hints whose accepted values are fixed by the renderer.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["把 safeArea 改为 left、right 或 none","把 taskMode 改为规范允许的枚举值"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}