glanceapp/glance · error

page %d must have either 1 or 2 full width columns

Error message

page %d must have either 1 or 2 full width columns

What it means

After counting column sizes, the page must contain exactly 1 or 2 columns with size: full. Zero full columns (e.g. all small) or three or more full columns both fail. This mirrors the CSS grid, which is built around full-width column slots.

Source

Thrown at internal/glance/config.go:532

			}
		}

		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]++
		}

		full := columnSizesCount["full"]

		if full > 2 || full == 0 {
			return fmt.Errorf("page %d must have either 1 or 2 full width columns", i+1)
		}
	}

	return nil
}

// Read-only way to store ordered maps from a YAML structure
type orderedYAMLMap[K comparable, V any] struct {
	keys []K
	data map[K]V
}

func newOrderedYAMLMap[K comparable, V any](keys []K, values []V) (*orderedYAMLMap[K, V], error) {
	if len(keys) != len(values) {
		return nil, fmt.Errorf("keys and values must have the same length")
	}

	om := &orderedYAMLMap[K, V]{

View on GitHub (pinned to 91324e8de7)

Solutions

  1. If no column is full, change one column (typically the first) to size: full
  2. If three or more are full, downgrade extra full columns to small or remove them

Example fix

# before
columns:
  - size: small
  - size: small
# after
columns:
  - size: full
  - size: small
Defensive patterns

Strategy: validation

Validate before calling

for i, p := range cfg.Pages {
    full := 0
    for _, c := range p.Columns {
        if c.Size == "full" {
            full++
        }
    }
    if full < 1 || full > 2 {
        return fmt.Errorf("page %d needs 1 or 2 full columns, got %d", i+1, full)
    }
}

Prevention

When it happens

Trigger: A page whose columns are all size: small (full count 0), or a page with 3 full columns (e.g. width: wide with three size: full columns). The count comes from columnSizesCount['full'] after per-column validation.

Common situations: Marking every column small to squeeze more widgets; wide pages experimenting with three full columns; refactoring sizes and accidentally leaving no full column.

Related errors


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