BigPizzaV3/CodexPlusPlus · error

Dream Skin theme name is empty

Error message

Dream Skin theme name is empty

What it means

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.

Solutions

  1. Set a non-empty, trimmed name before saving (e.g. derive it from the id: 'my-theme' -> 'My Theme').
  2. Add UI/form validation requiring a non-blank theme name before constructing the draft.
  3. When importing, fall back to a default name (the id or 'Imported Theme') when the source name is blank.

Example fix

// before
let mut config = DreamSkinThemeConfig::default();
config.id = "solar".into(); // name left ""
save_dream_skin_theme(&state_dir, &draft(config))?;
// after
let mut config = DreamSkinThemeConfig::default();
config.id = "solar".into();
config.name = "Solar".into(); // non-empty display name
save_dream_skin_theme(&state_dir, &draft(config))?;
Defensive patterns

Strategy: validation

Validate before calling

let name = draft.config.name.trim();
if name.is_empty() {
    draft.config.name = derive_display_name(&draft.config.id); // e.g. "my-theme" -> "My Theme"
}

Type guard

fn has_display_name(c: &DreamSkinThemeConfig) -> bool { !c.name.trim().is_empty() }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/a8955186095aceef. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/dream_skin_library.rs:521

    let stored = load_stored_dream_skin_theme(state_dir, id)?;
    if stored.config.id == DreamSkinThemeConfig::default().id {
        bail!("built-in Dream Skin theme cannot be deleted");
    }
    remove_known_theme_directory(&directory)
}

fn validate_theme_draft(draft: &DreamSkinThemeDraft) -> anyhow::Result<()> {
    if draft.builtin {
        bail!("built-in Dream Skin theme is read-only");
    }
    if !valid_theme_id(&draft.config.id) {
        bail!("invalid Dream Skin theme id");
    }
    if draft.config.schema_version != 1 {
        bail!("unsupported Dream Skin theme schema");
    }
    if draft.config.name.trim().is_empty() {
        bail!("Dream Skin theme name is empty");
    }
    if !draft.config.style_preset.is_empty() && !valid_theme_id(&draft.config.style_preset) {
        bail!("invalid Dream Skin style preset");
    }
    if let Some(colors) = &draft.config.colors {
        for color in [
            &colors.background,
            &colors.panel,
            &colors.panel_alt,
            &colors.accent,
            &colors.accent_alt,
            &colors.secondary,
            &colors.highlight,
            &colors.text,
            &colors.muted,
            &colors.line,
        ] {
            if !valid_css_color(color) {

View on GitHub (pinned to b1ed92e5e4)