Something went wrong

Thank you for being patient! We're working hard on resolving the issue

System Rows - Lona Docs Log in

System Rows

System rows are canonical header / footer / debug / banner rows the renderer expects every sheet to carry. They aren't stored in the wire data — they're synthesized from SystemRowsConfig per TREE-SPEC §8.8.

Static catalogs

import { HEADERS_STATIC, FOOTERS_STATIC } from "@tento-lona/sheets";
  • HEADERS_STATICsystem(header), system(month-banner), per-secondary-calendar headers
  • FOOTERS_STATICsystem(footer), system(footer|disclaimer) for ephemeral sheets

Each is a SystemRowDef[] — a tiny wire-shape descriptor the builder turns into a real SystemRow.

Building system rows

import { buildSystemRows, SystemRowsConfig } from "@tento-lona/sheets";

const config: SystemRowsConfig = {
  showSecondaryCalendars: prefs.calendarSystem.show,
  showSecondHeaderRows: prefs.calendarSystem.show2nd,
  isEphemeral: sheet.isEphemeral,
  /* ... */
};

const result = buildSystemRows(sheet, config);
result.headers;   // SystemRow[] to splice at top of tree
result.footers;   // SystemRow[] to splice at bottom
result.debug;     // optional debug rows

buildSystemRows is a pure function of (sheet, config). The SDK side wraps this to read preferences and pass the resolved config in.

Splicing into the tree

The DOM render path runs:

1. Sheet.allRows()                ← user rows
2. buildSystemRows(...)           ← system rows from config
3. applySecondaryCalendars(...)   ← per-secondary-calendar header rows
4. applySecondHeaderRows(...)     ← second header row variants

The CLI render path runs the same sequence so snapshots cross-validate.

SystemRow shape

interface SystemRow extends SheetRow {
  isSystemRow: true;
  isFooterRow: boolean;
  systemKey: string;        // "header", "footer", "footer|disclaimer", …
}

SystemRow is identifiable by row.id.key.isSystem() — see Row Identity.

Custom system rows

App code can extend the catalogs at startup:

import { HEADERS_STATIC } from "@tento-lona/sheets";

HEADERS_STATIC.push({
  systemKey: "my-banner",
  layoutType: "block",
  /* ... */
});

Note: extending the static catalogs means every sheet picks the addition up. Prefer SystemRowsConfig toggles for opt-in features.

See also