# Whiteboard planning

These elements hold their content as items and lay them out themselves, so
nothing inside can overlap. The server sizes them from their items: give no
w/h. Pass `items` with add (ids are generated) or change them later:
- {op:"add_item", id, item:{...}, index?} returns item_id;
- {op:"update_item", id, item_id, fields:{...}}; null removes status or hue;
- {op:"delete_item", id, item_id}.
At most 200 items per element; item text ≤500 characters. status is
open|doing|blocked|done, hue 0..359; both optional. A slot must name an
existing column, row or cell, timeline items must lie within start..end:
add columns or widen the range first.

- kanban: title, cols (1..8 titles ≤80, default To do, Doing, Done). Items
  {text, slot (column index 0..7), status?, hue?}; a card shows two lines.
  Move a card with update_item fields {slot}.
- matrix: title, preset eisenhower|swot|impact_effort|retro|custom, cols and
  rows (1..4 titles ≤80 each). Items {text, slot "row:col" (e.g. "0:1"),
  status?, hue?}. The preset only marks the template; always pass cols and
  rows, in the user's language. English examples:
  eisenhower cols ["Urgent", "Not urgent"], rows ["Important", "Not important"];
  swot cols ["Helpful", "Harmful"], rows ["Internal", "External"] (cells
  Strengths, Weaknesses, Opportunities, Threats);
  impact_effort cols ["Low effort", "High effort"], rows ["High impact",
  "Low impact"];
  retro cols ["Went well", "To improve", "Actions"], rows [""].
- calendar: title, month "YYYY-MM" (default: this month). Items {text, slot
  "YYYY-MM-DD", status?, hue?}; weeks start on Monday, people page through
  months in the browser.
  {"op": "add", "type": "calendar", "title": "October", "month": "2026-10",
   "items": [{"text": "Board meeting", "slot": "2026-10-14"}]}
- timeline: title, start, end ("YYYY-MM-DD", start ≤ end; default today to
  8 weeks later), unit day|week|month (default week).
  Items {text, start, end, hue?} within the range; start = end is a milestone.
  Overlapping bars stack in lanes. Width is units x 32 (day), 80 (week) or 120
  (month): for more than two months prefer week or month.
- table: title, cols (1..12 titles ≤80, default three empty columns). Items
  {cells: [one string ≤500 per column]}; cells show one line.
  {"op": "add", "type": "table", "title": "Owners", "cols": ["Task", "Owner"],
   "items": [{"cells": ["Checkout", "Ana"]}, {"cells": ["Reports", "Luis"]}]}

Write titles and item text in the user's language; the kanban default
columns are English.

Example, a sprint board, a quarter timeline beside it and a matrix below,
centered (1232 x 772 together):
{"document_id": "...", "ops": [
  {"op": "add", "type": "kanban", "title": "Sprint 12",
   "place": {"at": {"x": -616, "y": -386}}, "items": [
    {"text": "Login bug", "slot": 1, "status": "doing"},
    {"text": "Release notes", "slot": 0}]},
  {"op": "add", "type": "timeline", "title": "Q4", "start": "2026-10-01",
   "end": "2026-12-31", "unit": "month", "place": {"right_of": "$0", "gap": 80},
   "items": [{"text": "Beta", "start": "2026-10-05", "end": "2026-11-13"},
             {"text": "Launch", "start": "2026-12-01", "end": "2026-12-01"}]},
  {"op": "add", "type": "matrix", "preset": "eisenhower", "title": "Priorities",
   "cols": ["Urgent", "Not urgent"], "rows": ["Important", "Not important"],
   "items": [{"text": "Fix payments", "slot": "0:0"}],
   "place": {"below": "$0", "gap": 80}},
  {"op": "add_item", "id": "$0", "item": {"text": "QA pass", "slot": 2, "status": "done"}}
]}
