glanceapp/glance · error

page %d is slim and cannot have more than 2 columns

Error message

page %d is slim and cannot have more than 2 columns

What it means

A page marked width: slim is limited to at most 2 columns, and this page has 3+. Slim pages use a narrower layout that cannot fit three columns, so validation rejects it.

Source

Thrown at internal/glance/config.go:509

		}

		if page.Width != "" && (page.Width != "wide" && page.Width != "slim" && page.Width != "default") {
			return fmt.Errorf("page %d: width can only be either wide or slim", i+1)
		}

		if page.DesktopNavigationWidth != "" {
			if page.DesktopNavigationWidth != "wide" && page.DesktopNavigationWidth != "slim" && page.DesktopNavigationWidth != "default" {
				return fmt.Errorf("page %d: desktop-navigation-width can only be either wide or slim", i+1)
			}
		}

		if len(page.Columns) == 0 {
			return fmt.Errorf("page %d has no columns", i+1)
		}

		if page.Width == "slim" {
			if len(page.Columns) > 2 {
				return fmt.Errorf("page %d is slim and cannot have more than 2 columns", i+1)
			}
		} else {
			if len(page.Columns) > 3 {
				return fmt.Errorf("page %d has more than 3 columns", i+1)
			}
		}

		columnSizesCount := make(map[string]int)

		for j := range page.Columns {
			column := &page.Columns[j]

			if column.Size != "small" && column.Size != "full" {
				return fmt.Errorf("column %d of page %d: size can only be either small or full", j+1, i+1)
			}

			columnSizesCount[page.Columns[j].Size]++
		}

View on GitHub (pinned to 91324e8de7)

Solutions

  1. Reduce the page to 2 columns or fewer, merging widget lists
  2. Or drop the slim width (set wide/default) to keep 3 columns

Example fix

# before
- name: Home
  width: slim
  columns:
    - size: full
    - size: small
    - size: small
# after
- name: Home
  width: slim
  columns:
    - size: full
    - size: small
Defensive patterns

Strategy: validation

Validate before calling

for i, p := range cfg.Pages {
    if p.Width == "slim" && len(p.Columns) > 2 {
        return fmt.Errorf("page %d: slim allows max 2 columns", i+1)
    }
}

Prevention

When it happens

Trigger: pages[N].width == "slim" together with len(pages[N].columns) > 2. Note this check runs even if width was defaulted or invalid (the else-branch handles non-slim), so slim + 3 columns is the exact trigger.

Common situations: Copying a 3-column page and adding width: slim; deciding to slim a page without restructuring its columns.

Related errors


AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15). Data as JSON: /api/errors/2d2d326e33b95588. Report an issue: GitHub.