zed-industries/zed · error

Unknown layout: `{}`

Error message

Unknown layout: `{}`

What it means

parse_layout encountered a persisted preview layout string that matches none of the known values ('hidden', 'below', 'right', 'none'). The saved settings value is from a newer version or was hand-edited, so it cannot be mapped back to a preview::Layout.

Source

Thrown at crates/picker/src/persistence.rs:121

    format!("{picker_delegate}/LAST_PREVIEW_LAYOUT")
}

fn layout_as_str(layout: Option<preview::Layout>) -> &'static str {
    match layout {
        Some(preview::Layout::Hidden) => "hidden",
        Some(preview::Layout::Below) => "below",
        Some(preview::Layout::Right) => "right",
        None => "none",
    }
}

fn parse_layout(s: &str) -> anyhow::Result<Option<preview::Layout>> {
    Ok(Some(match s {
        "hidden" => preview::Layout::Hidden,
        "below" => preview::Layout::Below,
        "right" => preview::Layout::Right,
        "none" => return Ok(None),
        _ => return Err(anyhow!("Unknown layout: `{}`", s)),
    }))
}

/// A resized picker for persisting its size. All values are stored as fractions
/// of the viewport so they remain meaningful across window sizes.
#[derive(Clone, Copy, serde::Serialize, serde::Deserialize)]
pub(crate) struct PickerConfig {
    width: f32,        // relative fraction of viewport
    height: f32,       // relative fraction of viewport
    preview_size: f32, // relative fraction of viewport
}

impl PickerConfig {
    pub(crate) fn from_centered(shape: Centered, window: &Window) -> Self {
        PickerConfig {
            width: shape.width.as_viewport_fraction(window).raw(),
            height: shape.height.as_viewport_fraction(window).raw(),
            preview_size: shape.preview_size.raw(),

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Reset the corrupted settings entry so a valid layout is persisted next time
  2. If introduced by an upgrade, add the new layout keyword to parse_layout or migrate the stored value
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/picker/src/persistence.rs:116 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/de0bbba1c9c3855d. Report an issue: GitHub.