Architecture decision record · ADR-0021

The Marquetry catalog entries (@ember-lattice/marquetry)

@ember-lattice/marquetry (packages/marquetry) holds the entries.

Status
Proposed
Deciders
Joe Gaudet
Created
Updated
PRD
PRD
Related
None

Context

Plan section 3 names a package @ember-lattice/marquetry with "Marquetry catalog entries for Lattice surfaces". Plan section 11 asks for one entry for each surface, so that a model can stream a Lattice grid. Marquetry 1.0.0 is on npm. A catalog entry has two parts: a definition in a catalog (defineCatalog from @ember-marquetry/core: a description and a Standard Schema for the props) and a Glimmer component in a registry (defineRegistry from @ember-marquetry/ember). The Joinery data table add-on (@ember-marquetry/joinery/data-table) is the model for this shape.

Decision drivers

Not recorded in the original ADR.

Options considered

Not recorded in the original ADR.

Decision

1. The package is in this repo, and Marquetry is a peer

  • @ember-lattice/marquetry (packages/marquetry) holds the entries. The Marquetry repo gets only a docs section that names the package (docs/release/marquetry-entry/).
  • @ember-marquetry/core and @ember-marquetry/ember are peer dependencies (^1.0.0). The app owns its Marquetry copy: mergeCatalogs, mergeRegistries and <Render> come from it.
  • The props schemas use zod 4, as the Joinery catalog does.

2. Two entry points

  • @ember-lattice/marquetry: latticeCatalog and latticeRegistry, with LatticeGrid, LatticeList and LatticeBoard. They need only core and ember.
  • @ember-lattice/marquetry/sheet: latticeSheetCatalog and createLatticeSheetRegistry({ engine }), with LatticeSheet. The sheet packages (sheet, formula, editing) are optional peers, so an app without a sheet does not install them.
  • The sheet needs a FormulaEngine, and only the app can choose it (IronCalc in a worker, or another engine). Thus the sheet registry is a function of the engine, not a constant.

3. The props are plain data that a model can write

  • LatticeGrid: label, columns (key, label, sortable, align, width), rows (records of plain values), rowKey, density, height.
  • LatticeList: label, items (id, title, description), a bindable selection, multiselect, height. The list is a listbox, so each item takes the focus with no control in it. The event is selectionChange.
  • LatticeBoard: label, lanes (key, label), and bindable cards (id, title, lane, description). A move writes the new cards and emits move with the card ID, the lanes and the index.
  • LatticeSheet: label, sheets (name, rows, cols, cells), height. A cell has an A1 ref, and a value or a formula in A1 form. The component loads the values, then enters each formula with Workbook.setInput, which converts A1 refs to the stored ID form (ADR 0015). A ref outside the sheet goes to @report. It is not dropped silently.
  • A prop that a list or a board writes (selection, cards) writes the state through @update when the spec binds it. When the spec does not bind it, the component keeps the value itself.

4. One table for each grid, updated in place

The grid component makes its table one time. When the spec changes the rows or the columns (a model streams them), a modifier calls table.setOptions with the new data. It does this in the afterRender queue, because the grid read the table options in the same render. Thus the sort and the other table state stay while the rows stream in. The column definitions are made again only when the columns prop changes.

5. The sheet loads again when the spec changes its sheets

The sheet component makes a new Workbook each time the sheets prop changes. The user edits go to the workbook, not to the spec, so they do not cause a new load.

Consequences

  • An app merges the entries with its own catalog: mergeCatalogs(catalog, latticeCatalog) and mergeRegistries(registry, latticeRegistry).
  • The tests are in test-app/tests/marquetry/. Each one renders a spec through <Render> and ends with an axe audit.
  • This is a new npm name, so its first release needs a trusted publisher on npm.
  • shortcut: a sheet that streams in loads one time for each change of sheets; when models stream large sheets, add the new cells with Workbook.apply instead.
  • Not in this ADR: a catalog entry for the grid UI parts (side bar, tool panels). Add one when a model needs them.

Confirmation

Not recorded in the original ADR.

Interview record

Each question of the interview with its answer and its source. A fact from the code or a document, a question that the author did not ask, and an assumption are rows too.

QuestionAnswerSource
Where does the text of this page come from?From the Markdown file docs/adr/0021-marquetry-catalog.md at commit 4c77ac4. The text of each section is the text of the Markdown file. A section that the Markdown file does not have says so.Document: docs/adr/0021-marquetry-catalog.md

Changelog

DateAuthorChange
2026-12-02Joe GaudetStatus in the Markdown file: proposed, 2026-12-02.
2026-12-03Joe GaudetCommit 7ce4af2: Lattice 1.0 (#1)
2026-12-04Joe Gaudet (agent)Converted from docs/adr/0021-marquetry-catalog.md to this page. The text is the text of the Markdown file.

The adr skill of skillsaw wrote this page. The HTML in this file is the source of truth. The diagrams are the Mermaid sources in it.