{"record":{"id":"a8955186095aceef","repo":"BigPizzaV3/CodexPlusPlus","slug":"dream-skin-theme-name-is-empty","errorCode":null,"errorMessage":"Dream Skin theme name is empty","messagePattern":"Dream Skin theme name is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_library.rs","lineNumber":521,"sourceCode":"    let stored = load_stored_dream_skin_theme(state_dir, id)?;\n    if stored.config.id == DreamSkinThemeConfig::default().id {\n        bail!(\"built-in Dream Skin theme cannot be deleted\");\n    }\n    remove_known_theme_directory(&directory)\n}\n\nfn validate_theme_draft(draft: &DreamSkinThemeDraft) -> anyhow::Result<()> {\n    if draft.builtin {\n        bail!(\"built-in Dream Skin theme is read-only\");\n    }\n    if !valid_theme_id(&draft.config.id) {\n        bail!(\"invalid Dream Skin theme id\");\n    }\n    if draft.config.schema_version != 1 {\n        bail!(\"unsupported Dream Skin theme schema\");\n    }\n    if draft.config.name.trim().is_empty() {\n        bail!(\"Dream Skin theme name is empty\");\n    }\n    if !draft.config.style_preset.is_empty() && !valid_theme_id(&draft.config.style_preset) {\n        bail!(\"invalid Dream Skin style preset\");\n    }\n    if let Some(colors) = &draft.config.colors {\n        for color in [\n            &colors.background,\n            &colors.panel,\n            &colors.panel_alt,\n            &colors.accent,\n            &colors.accent_alt,\n            &colors.secondary,\n            &colors.highlight,\n            &colors.text,\n            &colors.muted,\n            &colors.line,\n        ] {\n            if !valid_css_color(color) {","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_library.rs#L503-L539","documentation":"validate_theme_draft rejects a draft whose config.name is empty or whitespace-only after trimming. The name is the human-readable label shown in the theme picker, so every theme must carry a non-empty one. The id can be a slug, but the name is the required display field.","triggerScenarios":"Saving/importing/activating with a draft whose config.name is \"\" or only whitespace (spaces, tabs, newlines); deserializing a theme.json that omits name (yields empty string); building a config from a form where the name field was never filled.","commonSituations":"Programmatic theme creation where only the id was set; imported package with a missing/blank name; form validation gap in a UI that lets the user submit with an empty theme title.","solutions":["Set a non-empty, trimmed name before saving (e.g. derive it from the id: 'my-theme' -> 'My Theme').","Add UI/form validation requiring a non-blank theme name before constructing the draft.","When importing, fall back to a default name (the id or 'Imported Theme') when the source name is blank."],"exampleFix":"// before\nlet mut config = DreamSkinThemeConfig::default();\nconfig.id = \"solar\".into(); // name left \"\"\nsave_dream_skin_theme(&state_dir, &draft(config))?;\n// after\nlet mut config = DreamSkinThemeConfig::default();\nconfig.id = \"solar\".into();\nconfig.name = \"Solar\".into(); // non-empty display name\nsave_dream_skin_theme(&state_dir, &draft(config))?;","handlingStrategy":"validation","validationCode":"let name = draft.config.name.trim();\nif name.is_empty() {\n    draft.config.name = derive_display_name(&draft.config.id); // e.g. \"my-theme\" -> \"My Theme\"\n}","typeGuard":"fn has_display_name(c: &DreamSkinThemeConfig) -> bool { !c.name.trim().is_empty() }","tryCatchPattern":null,"preventionTips":["Require a non-blank name in creation forms before submit.","Default name from the id when the field is left blank.","On import, fall back to the id or a placeholder name for blank names."],"tags":["validation","empty-field","theme","rust"],"backgroundTag":"empty-required-field","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}