M2 contract: the Grid surface
This file is the contract between the three M2 tracks: the Grid surface (@ember-lattice/ember), the theme (@ember-lattice/theme) and the harnesses (@ember-lattice/test-support).
Summary
Date: 2026-12-01. This file is the contract between the three M2 tracks: the Grid surface
(@ember-lattice/ember), the theme (@ember-lattice/theme) and the harnesses
(@ember-lattice/test-support). Each track builds against this file. To change the contract,
change this file first and say so in the report.
Sources: plan sections 4.6 to 4.10, ADR 0002 (row recycling), ADR 0003 (scaled scroll), ADR 0004 (pinned columns and RTL).
Glossary
Not recorded in the original plan.
Problem and context
Not recorded in the original plan.
Goals and non-goals
Not recorded in the original plan.
Customers
Not recorded in the original plan.
Internal stakeholders
Not recorded in the original plan.
Users and scenarios
Not recorded in the original plan.
Landscape and constraints
Not recorded in the original plan.
Proposed design
5. Harnesses (@ember-lattice/test-support)
Built on harnessed (ComponentHarness, @ByRole). The grid harness finds the grid by its
accessible name. Use GridHarness.named(env, label, scope, role). The role is 'grid'
(default) or 'treegrid'.
class GridHarness extends ComponentHarness {
rowCount(): Promise<number> // aria-rowcount minus the header rows and the total row
columnCount(): Promise<number> // aria-colcount
renderedRowIndexes(): Promise<number[]> // aria-rowindex of rendered body rows
headers(): Query<HeaderCellHarness> // in visual order
header(name: string): HeaderCellHarness // by its label text
cell(rowIndex: number, column: string): CellHarness // rowIndex: 0-based data row
activeCell(): Promise<{ rowIndex: number; column: string } | null>
scrollToRow(rowIndex: number): Promise<void>
press(key: string, modifiers?: Modifiers): Promise<void> // on the active cell
}
class HeaderCellHarness {
text()
sort(): Promise<'ascending' | 'descending' | 'none'>
toggleSort()
width()
resizeBy(dx: number)
isPinned(): Promise<'start' | 'end' | null>
}
class CellHarness {
text()
focus()
isActive()
isSelected()
click()
doubleClick()
}
The harness reads only the DOM in section 2 and the ARIA attributes. It never reads Lattice internals, so the same harness works under QUnit and Playwright.
7. Server row models (M4, 2026-12-01)
@rowModel(optional): a row model from@ember-lattice/data(infinite, cursor, server, viewport). Without it, the Grid uses the client model of the table.- Unloaded rows render as skeleton rows:
aria-busy="true"on the row anddata-loadingon its cells. Rows of a failed block havedata-failed. aria-rowcountis-1when the row count is not known (ARIA rule).- With server groups the Grid is
role="treegrid". Group rows havearia-levelandaria-expanded. The toggle isbutton.lt-group-toggle, and the label isspan.lt-group-label. Enter on a group row toggles it. - The theme styles
.lt-cell[data-loading],[data-failed]and the toggle chevron. LatticeGrid.stateHost()returns aGridStateHandle(packages/ember/src/grid/state-host.ts). Give it to@stateHostand topersistGridState({ host })(ADR 0011).- The harness finds
role=gridandrole=treegrid(see section 5).
8. Editing (M6, 2026-12-01)
ADR 0012 has the decisions. @ember-lattice/editing has the use.
@editing(optional): aGridEditingobject, for example anEditControllerfrom@ember-lattice/editing. Without it, the Grid does not edit, paste, cut or fill.The editor renders in
.lt-overlay, outsiderole=grid:div.lt-overlay div.lt-editor data-lt-edit-state=editing|validating|... on the edited cell the control (the Formwright control; id = the editor ID; aria-label = the header) div.lt-editor-error role=alert one for each errorCells: with the engine cell selection, each body cell has
aria-selected(truein a range, elsefalse), and the grid hasaria-multiselectable="true". A cell in a range hasdata-range-edge: a list of the range edges that the cell is on, fromblock-start,block-end,inline-startandinline-end, in that order. The theme draws the range borders from it. A cell with a staged value hasdata-dirty. The end corner cell of the last range hasdiv.lt-fill-handle(aria-hidden="true") when@editingis given.The edited row is held like the active row (
data-heldoutside the range). The editor follows its cell when the grid scrolls. When the cell is out of the view, the editor getsdata-lt-offscreenand a clip. The control keeps the focus, and the edit stays open.Popup edit: a column with
meta.lattice.editMode: 'popup'opens its editor under the cell, withdata-lt-edit-mode="popup". Other editors havedata-lt-edit-mode="cell". A popup editor has the cell width as its minimum width, so it can be larger than the cell. When it does not fit under the cell in the view, it opens over the cell. When it fits neither, it moves up into the view, over the cell.Edit triggers (2026-12-02):
@editTriggeris the pointer action that opens an editor:doubleClick(the default),singleClickornone. A columnmeta.lattice.editTriggerwins. A group row never opens an editor: a double click and Enter toggle it. Enter, F2 and a printable key open the editor with each trigger. A click with Shift, Ctrl, Meta or Alt, and a click on a button or a link in the cell, do not open an editor. A double click on a cell that opens no editor calls@onCellActivate. A press on a cell saves the open edit first; when that value is not valid, the edit stays open and no new editor opens.The editor focus: the grid focuses the element with the editor ID. When that element cannot take the focus, the focus goes to its first
:checkedor[tabindex="0"]element, else to its first control.The editor keys: a key that a control in the editor cancels (
preventDefault) is not a grid key. Escape runs in the capture phase of.lt-overlay, so a control that stops the key in the bubble phase cannot keep the edit open; a layer that Escape closes (a list, a popover) cancels the key, and the edit stays open. Enter on abuttonin the editor (a calendar day) saves after the click of the button.Save on focus out (2026-12-02): with
@stopEditingWhenCellsLoseFocus, a cell edit (not a full-row edit) saves when the focus moves to an element outside.lt-overlay, or on a press outside.lt-grid-root. The focus stays where it went. Without it, the edit stays open; a press on a body cell still saves. Popups of the editor must stay in the DOM of the editor (thepopovertop layer does), or a press in them saves the edit.Full-row edit: with an
@editingthat hasmode: 'row'(new EditController({ rowEdit: true })), Enter or F2 opensdiv.lt-row-editor(role="group",aria-label="Edit row <n>") in the overlay. It has one field (.lt-row-editor-field) over each editable cell. Tab moves between the fields. Enter validates all fields and saves the changed values as one undo step. Escape cancels all fields. Errors show asrole="alert"items, with the column name first.Server rows: with
@rowModeland a table that has the cell selection feature, the Grid owns one range (Shift+arrows, Ctrl+A). A copy takes the loaded rows of the range. A paste that reaches a row that is not loaded is refused as a whole, and the live region says "Paste refused: some rows are not loaded.".Keys, added to section 3:
Key Action Enter, F2, a printable key With @editingand a columneditor: open the editor.Click, double click Open the editor, by @editTrigger(default: double click).Enter, Tab, Escape (editor) Commit and move down, commit and move to the inline end, or cancel. Shift+arrows Extend the last range (cell selection). Ctrl+A Select all cells (cell selection); else all rows. See the rule. Ctrl+C, Ctrl+X, Ctrl+V The copy,cutandpasteevents: TSV and HTML.Ctrl+Z, Ctrl+Shift+Z, Ctrl+Y Undo and redo ( @editing).Ctrl+A rule (2026-12-02): when the table has the cell selection feature, Ctrl+A selects all cells and no rows, also when the table has row selection. When the table has row selection only (and multi-select), Ctrl+A selects all rows.
The theme styles
.lt-cell[aria-selected='true']with--lt-range-bgand--lt-range-border, and styles.lt-editor,.lt-editor-errorand.lt-fill-handle.Harness:
CellHarness.isInRange()(the cellaria-selected) andCellHarness.isDirty().
9. Extension points (M7, 2026-12-02)
ADR 0013 has the list of the hooks that @ember-lattice/ui needs. @ember-lattice/ember must not
import @ember-lattice/ui, so each hook takes a component, a block or a plain object.
<LatticeGrid
@table={{this.table}}
@label='Orders'
@density='compact'
{{! compact | normal (default) | comfortable: data-lt-density on .lt-grid }}
@find={{this.findModel}}
{{! an object with matchAt(rowId, columnId): a FindModel }}
@floatingFilter={{GridFloatingFilter}}
{{! a component with Args { column }: adds the floating filter row }}
@onCellContextMenu={{this.onMenu}}
{{! called with { row, column, x, y, keyboard } }}
>
<:sideBar><SideBar @table={{this.table}} /></:sideBar>
<:contextMenu as |menu|><GridContextMenu @menu={{menu}} /></:contextMenu>
</LatticeGrid>
- Density.
@densitysetsdata-lt-densityon.lt-grid. The Grid reads the new row height when the attribute changes. - Header slot. A column with
meta.lattice.header(a component withArgs: { column, grid }) getsspan.lt-header-slotin its leaf header cell, after the label.gridis aGridHeaderApiwithautoSizeColumns(columnIds?). With no IDs, it sizes the columns that can resize. A floating filter gets the same args. A leaf header cell with a slot hasaria-labelwith the label text, so its name does not include the names of the slot controls (ADR 0026). A click or a press in the slot does not sort and does not start a column drag. The controls in the slot must havetabindex="-1". F2 on the header cell moves the focus to the first control in the slot. Escape in the slot moves the focus back to the header cell (a menu or a dialog in the slot handles its own Escape). - Floating filter row. With
@floatingFilter, the header has one more row,div.lt-row.lt-header-row.lt-floating-row, after the leaf header row. Its cells arediv.lt-header-cell.lt-floating-cell role="gridcell", witharia-colindex,data-column-idandtabindexas in a body row, and each one holds the component.aria-rowcountand thearia-rowindexof the body rows count this row. The arrow keys move through it. Enter or F2 on a floating cell moves the focus to its control; Escape moves it back to the cell. - Find. With
@find, each body cell hasdata-find-match="current|match"frommatchAt(row.id, column.id), or no attribute. - Scroll to a cell.
GridStateHandle.scrollToCell(rowId, columnId)makes the cell the active cell and scrolls it into view. The focus does not move. It returns false when the grid has not rendered, or when it has no such row (with a row model: no loaded row) or column.FindBar @grid={{handle}}calls it for the current match. - Live region.
div.lt-live role="status"is in.lt-grid-root, outsiderole=grid, and is visually hidden. Its name is the locale textgrid.messages. It has three parts:[data-live="message"](a sort change, a refused paste),[data-live="edit"](@editing.message: a save, a failed save, a paste result) and[data-live="count"](the row count, for example "12 rows", after a filter). - Context menu. A right click on a body cell, Shift+F10 or the ContextMenu key (APG) makes the
cell the active cell and opens a request. One key press opens one request: the
contextmenuevent that the browser sends after the key is ignored. The Grid calls@onCellContextMenuand renders thecontextMenublock in.lt-overlaywith{ target, selection, close, copyText, pasteText }(GridContextMenuApi).copyText(withHeaders)gives the selection as TSV.pasteText(text)pastes through@editing. With no hook and no block, the browser menu opens. - Side bar. The
sideBarblock renders indiv.lt-side-bar-region, after.lt-gridin.lt-grid-root, outsiderole=grid. With the block, the root is a flex row and the grid takes the free space, so the side bar is at the inline end. - Harness:
CellHarness.findMatch()givescurrent,matchor null.GridHarness.rowCount()does not count the floating filter row.
10. Row features (2026-12-02)
ADR 0018 has the decisions.
<LatticeGrid
@table={{this.table}}
@label='Orders'
@rowHeight='auto'
{{! a number, or 'auto': each row has the measured height of its content }}
@isFullWidthRow={{this.isBanner}}
@fullWidthRow={{Banner}}
{{! a component with Args { row } }}
@detailRow={{OrderLines}}
{{! master/detail: a component with Args { row } }}
@hasDetail={{this.hasLines}}
@loading={{this.loading}}
@onRowMove={{this.move}}
{{! called with { row, fromIndex, toIndex } }}
@onRowDrop={{this.receive}}
{{! called with { row, source, toIndex } for a row from another grid }}
/>
One row list. All body rows are in
.lt-body, in one index: the pinned top rows, the other rows (with an open detail row after its master row), then the pinned bottom rows.aria-rowcountcounts all of them.Client groups and tree data. A table with the engine expanding feature makes the grid
role="treegrid". Each row hasaria-level(depth + 1). A group row hasaria-expanded,button.lt-group-toggleandspan.lt-group-label(East (3)) in the first cell, as a server group (section 7), and the aggregates in the other cells. A tree row with sub rows hasaria-expandedand the toggle before its value. Enter toggles a group or tree row.Sticky rows. An open group or tree row that is a parent of a row in view has
data-sticky. It stays under the header, one row height lower for each level, until the end of its group.Pinned rows. A row of the engine row pinning has
data-row-pinned="top|bottom". Top rows stay under the header and bottom rows stay at the end of the view. The scroller has the CSS variables--lt-view-topand--lt-view-bottomfor these rows.Row numbers.
rowNumberColumn()is a column def. Its column is pinned at the start, and its cells show the 1-based display position.Full-width and detail rows.
div.lt-row(with.lt-detail-rowfor a detail row) has onediv.lt-cell.lt-full-width-cell role="gridcell" aria-colindex="1" aria-colspan="<all>". The first cell of a master row hasbutton.lt-group-toggle.lt-detail-togglewitharia-label="Details"andaria-expanded. A nested grid in a detail row has its own keys.Measured rows. With
@rowHeight="auto"or an open detail row, rows havedata-indexand an inlineblock-size: auto, and the grid measures them.Row drag. A column with
meta.lattice.rowDraghasspan.lt-row-drag-handle(aria-hidden="true") in its cells. Alt+ArrowUp and Alt+ArrowDown move the row of the active cell. The live region says "Moved row 3 to row 4". While a drag runs,.lt-gridhasdata-row-dragging.Cell spanning. With the engine cell spanning feature, a spanning cell has
aria-rowspanoraria-colspan. A covered cell is not rendered. A row span leaves anaria-hiddenspacer.Overlays.
div.lt-overlay-message role="status"is in.lt-grid-root, outsiderole=grid: "Loading…" while@loading(the grid then hasaria-busy="true"), else "No rows" when the grid has no rows. Its name is the locale textgrid.status.Tooltips. A column
meta.lattice.tooltip(value, row)givesdiv.lt-tooltip role="tooltip"in.lt-grid-rooton hover or focus of a cell. The cell then hasaria-describedby.Touch. A touch press of 500 ms on a body cell opens the context menu (section 9).
Keys, added to section 3:
Key Action Enter (group or tree row) Open or close the row. Alt+ArrowUp, Alt+ArrowDown With @onRowMove: move the row of the active cell.Escape Close the tooltip.
11. Column sizing, alignment, external filter, notes and hooks (2026-12-02)
ADR 0023 has the decisions.
<LatticeGrid
@table={{this.table}}
@label='Orders'
@externalFilter={{this.passes}}
{{! (row) => boolean: client rows that return false do not show }}
@notes={{this.notes}}
{{! an object with noteAt(rowId, columnId): the note text or undefined }}
@aligned={{this.alignment}}
{{! a GridAlignment from LatticeGrid.alignment(), given to two or more grids }}
@locale='de-DE'
{{! the locale of column type formats; default: the runtime locale }}
/>
- Flex widths. A column def with
flexgets a share of the free width of the scroller (coreapplyFlexWidths). The grid applies the shares after the first render, when the scroller width changes (ResizeObserver), and after a column resize. A resize of a flex column takes it out of flex: it keeps its new size, and the other flex columns share the rest. - Auto-size. A double click on
.lt-resize-handlesizes its column to its widest rendered content: the header label and the rendered body cells (coreautoSizeColumns).GridStateHandle.autoSizeColumns(columnIds?)sizes all columns, or the given columns. A column that is not rendered keeps its size. - Auto-generated columns. When the table has no leaf columns and has rows, the
grid sets
autoColumns(rows)on the table (table.setOptions), after the render. Rows that come later (the first data that is not empty) also get columns.autoColumns(rows, { types })is also exported: it makes one column for each key of the first 10 rows. A key whose first value fits a type (type.isValue(value)) getsmeta.columnType. - Column types. A column with
meta.columnType(from@ember-lattice/column-typescolumnType()) showstype.format(value, @locale)in a cheap cell.meta.lattice.formatwins. - Aligned grids. All grids with the same
@alignedhandle have the same horizontal scroll, and the same column sizes, order and visibility for the column IDs that they share. A change in one grid goes to the others. - External filter. With
@externalFilter, the grid shows only the client rows (not the pinned rows) that pass. Tracked state that the function reads makes the grid filter again.aria-rowcountand the count in the live region count the rows that pass. - Notes. With
@notes, a body cell that has a note hasdata-note. When a cell with a note is hovered or has the focus,div.lt-note role="note"shows its text in.lt-grid-root, outsiderole=grid, under the cell. When the tooltip of the cell is open too, the note is under the tooltip, so they do not overlap. The cell then hasaria-describedbywith the ID of the note (and of the tooltip, when it has one). - Header label slot. A column with
meta.lattice.headerLabel(a component withArgs: { column, label }) renders it inspan.lt-header-labelin place of the text. A click or a press on a control in it does not sort and does not start a column drag. F2 and Escape work as in the header slot (section 9). - Row header. The cells of the row number column (
rowNumberColumn()) haverole="rowheader", notgridcell. - Context menu.
GridContextMenuApi.selectionis the list of the current ranges, asGridRange(0-based display indexes). It has the grid range of@rowModeltoo, and the active cell when there is no range. - Row slot attribute. The recycle slot of a body row is
data-lt-slot, notdata-slot. Joinery and shadcn usedata-slotas a component marker (research S13).
12. Grid hooks, round 2 (2026-12-02)
ADR 0026 has the decisions.
Cell description.
meta.lattice.cellDescription(row, column)gives the accessible description of a cell, or undefined. The text is in a hiddendiv.lt-cell-descriptionsin.lt-grid-root, outsiderole=grid, so it is not in the cell text. The cellaria-describedbyhas the ID of the description first, then the open tooltip and the open note.meta.lattice.cellInvalid(row, column)true gives the cellaria-invalid="true".Start an edit.
GridStateHandle.startEditing(rowId, columnId)opens the editor of the cell, as F2 does: the cell becomes the active cell, scrolls into view, and the editor gets the focus. It works with eacheditTrigger, alsonone. It gives false when the grid has not rendered, has no@editing, has no such loaded row or column, or cannot edit the cell.First render. The column virtualizer starts with the size of the window and the center columns. So the first render has the headers in view, before the grid measures its scroller. The body rows come in the render after the measure.
Keys, added to section 3 (with
@editingand the cell selection feature, not with@rowModel):Key Action Ctrl+D (Cmd+D) Fill down: the top row of the range fills the rows under it. Ctrl+R (Cmd+R) Fill right: the first column of the range fills the columns after it. In one row, Ctrl+D copies the row above. In one column, Ctrl+R copies the column at the inline start. The fill is the same edit as the fill handle (
@editing.fill), one undo step. A row number cell is not a source and not a target. The fill handle staysaria-hidden: these keys are its keyboard path.
User interface and prior art
2. DOM
div.lt-grid-root no role; dir? (see the rules); holds the grid and the overlay
div.lt-grid role=grid aria-label aria-rowcount aria-colcount aria-multiselectable?
data-lt-density data-lt-borders data-lt-zebra? dir?
div.lt-scroller the one scroll container (ADR 0004); no tabindex: axe flags it in role=grid
div.lt-sizer block-size = body rows only, no header (or the scaled size)
div.lt-header role=rowgroup sticky, inset-block-start: 0
div.lt-row.lt-header-row role=row aria-rowindex
div.lt-header-cell role=columnheader aria-colindex aria-sort? data-column-id
data-pinned=start|end? style="inline-size: <px>"
span.lt-header-label
div.lt-resize-handle role=separator aria-orientation=vertical
aria-valuenow aria-valuemin aria-valuemax aria-label
div.lt-body role=rowgroup
div.lt-row role=row aria-rowindex aria-selected? data-row-id data-lt-slot
data-held? style="transform: translateY(<px>)"
div.lt-spacer aria-hidden=true before the column range (inline-size)
div.lt-cell role=gridcell aria-colindex data-column-id data-pinned? tabindex=-1|0
div.lt-spacer aria-hidden=true after the column range
div.lt-footer role=rowgroup only with a grand total; sticky, inset-block-end: 0
div.lt-row.lt-total-row role=row aria-rowindex cells as in a body row
div.lt-overlay (sibling of div.lt-grid, inside div.lt-grid-root, outside role=grid; ADR 0002)
Rules:
dir: the Grid measures.lt-gridafter the first render. It then setsdirondiv.lt-grid-rootto the computed direction of.lt-grid(ltrorrtl)..lt-gridhas thedirthat the app gives it. The root copies it, so the overlay has the same direction.- Grand total: with a row model that has
totalRow, the Grid renders a thirdrowgroup,.lt-footer, after.lt-body. It has one.lt-total-row. It is sticky at the block end of the scroller. Column 1 shows "Total" when its column has no total value.aria-rowcountcounts the total row, and itsaria-rowindexis after the last data row. - Pivot columns: with a server row model that has a pivot, the result columns become leaf columns of the table, after its own columns. Each pivot key gives one header group, and each value gives one leaf. The leaf ID is the field of the result.
- Body rows use
translateYfrom the top of.lt-body, with no header offset. - The scroll range includes the sticky header. The Grid's virtualizer counts the header as
paddingStart. The theme gives.lt-sizermin-block-size: max-content, so the real scroll height is header plus body. Above the cap, the scale ratio is(rows height + header - viewport) / (scrollHeight - viewport)(ADR 0003). - Row height:
@rowHeightis optional. When it is given, the Grid sets--lt-row-heightinline to the same value. When it is not given, the Grid reads the computed--lt-row-height, so the density presets work. .lt-overlayis a 0×0 anchor at the inline start. It must not cover the grid, or axe checks no nodes.aria-rowcountcounts all rows, the header rows and the total row.aria-rowindexis 1-based and includes the header rows.aria-colcountandaria-colindexcount all leaf columns, also the ones that are not rendered.- Header groups (from
table.getHeaderGroups()) give onelt-header-roweach. A group header cell hasaria-colspan. - Pinned cells use
position: stickywithinset-inline-startorinset-inline-end, set as an inline style with the sum of the earlier pinned widths. - Rows are as wide as all columns (
inline-sizeon each row, ADR 0004 rule 1). - Held rows (the focused row, the edited row) render in the body with
data-heldand keep theiraria-rowindex, also when they are outside the range. - One tab stop: the cell with
tabindex=0is the active cell. All other cells havetabindex=-1.
Decision (2026-12-01): .lt-overlay is outside role=grid. LatticeGrid renders
div.lt-grid-root (no role). It holds div.lt-grid (role=grid) and div.lt-overlay as
siblings. Editors and popovers render in the overlay (M6).
3. Keyboard (APG grid pattern)
| Key | Action |
|---|---|
| Arrow keys | Move the active cell. In RTL, Left and Right swap. |
| Home / End | First or last cell in the row. |
| Ctrl+Home / Ctrl+End | First or last cell in the grid. |
| PageUp / PageDown | Move by the number of rows in view. |
| Enter | @onCellActivate; on a sortable header, toggle the sort. |
| Space | On a row with selection: toggle the row selection. |
| Shift+Space | Select the row (when selection is on). |
| Ctrl+A | Select all rows (when multi-select is on). |
The active cell scrolls into view. When the active row leaves the range, it is held (ADR 0002).
4. Theme
Classes are
.lt-*, inside:where()for zero specificity, in@layer lattice. The app loads Joinery'stokens.cssand a Joinery theme first.Tokens, on
.lt-grid, with Joinery tokens as defaults:Token Default --lt-row-height32px(compact28px, comfortable40px)--lt-header-heightvar(--lt-row-height)--lt-cell-padding-inline0.5rem--lt-font-size0.875rem--lt-bgvar(--background)--lt-fgvar(--foreground)--lt-header-bgvar(--muted)--lt-header-fg--muted-foregroundmixed with 30%--foreground(4.5:1 contrast)--lt-border-colorvar(--border)--lt-row-hover-bga mix of --mutedand--background--lt-row-selected-bga mix of --primaryand--background--lt-zebra-bga light mix of --muted--lt-focus-ring--ringmixed with 35%--foreground(3:1 contrast;--ringalone is 2.6:1)--lt-pinned-shadowa shadow on the inner edge of pinned columns --lt-range-bg,--lt-range-borderfor cell ranges (M6) --lt-resize-handlevar(--primary)Presets are data attributes on
.lt-grid:data-lt-density="compact|normal|comfortable",data-lt-borders="none|rows|cells",data-lt-zebra, anddata-lt-preset="sheet"(A1-style grid lines).listandboardpresets come in M3.Light, dark (the Joinery
.darkclass; Joinery has noprefers-color-schemerules) andforced-colorsmust all work. Text contrast is 4.5:1 or more in every preset.
Requirements
6. M2 feature list
- Row virtualization (fixed height) and column virtualization, with scaled scroll above 10M px.
- Hybrid row recycling, the held layer, the
cell.statestore (ADR 0002). - Header groups, sorting (click, Shift+click for multi-sort,
aria-sort), column resize (pointer drag on the handle, and the keyboard on the separator), column reorder (pointer drag of a header), pinning (sticky), visibility, row selection (a checkbox column from JoineryCheckbox). - Keyboard and focus as in section 3.
- Each render test ends with an axe audit.
Data model and API changes
1. Component API
<LatticeGrid
@table={{this.table}}
{{! a table from @ember-lattice/core constructTable }}
@label='Orders'
{{! required: the accessible name (aria-label) }}
@rowHeight={{32}}
{{! optional; else the computed --lt-row-height (section 2) }}
@overscan={{4}}
{{! rows outside the view on each side }}
@getRowId={{this.rowId}}
{{! optional; defaults to the table row id }}
@onCellActivate={{this.open}}
{{! optional: Enter or double click on a cell that does not open an editor }}
/>
LatticeGridis the export name from@ember-lattice/ember.The grid reads the table only. It writes state only through table APIs (
column.toggleSorting,column.getToggleSortingHandler,table.setColumnSizing,table.setColumnOrder,row.toggleSelected). It never writes state during render.Column options live in
columnDef.meta.lattice(typed by aColumnMetaaugmentation in@ember-lattice/ember):Key Type Meaning cellcomponent A full cell component. Signature: { Args: { cell, row, column, value, state } }.cellKind'cheap' | 'full''cheap'cells reuse row slots.'full'cells are keyed by row ID (ADR 0002). Default:'full'whencellis set, else'cheap'.format(value) => stringThe text of a cheap cell. Default: String(value ?? '').align'start' | 'end' | 'center'Text alignment (logical). stateis thecell.statestore: a tracked map keyed by row ID and column ID. A full cell keeps its own state there, so it stays correct when slots recycle.
Security and permissions
Not recorded in the original plan.
Observability and success metrics
Not recorded in the original plan.
Rollout and migration
Not recorded in the original plan.
Work items
Not recorded in the original plan.
Future work and research
Not recorded in the original plan.
Alternatives considered
Not recorded in the original plan.
Risks
Not recorded in the original plan.
Open questions
Not recorded in the original plan.
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.
| Question | Answer | Source |
|---|---|---|
| Where does the text of this page come from? | From the Markdown file docs/m2-grid-contract.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/m2-grid-contract.md |
Changelog
| Date | Author | Change |
|---|---|---|
| 2026-12-03 | Joe Gaudet | Commit 7ce4af2: Lattice 1.0 (#1) |
| 2026-12-04 | Joe Gaudet (agent) | Converted from docs/m2-grid-contract.md to this page. The text is the text of the Markdown file. |
| 2026-12-04 | Joe Gaudet (agent) | Status Shipped: the Grid surface of this contract is in version 1.0.0 of @ember-lattice/ember on npm (tag v1.0.0). |
The prd skill of skillsaw wrote this page. The HTML in this file is the source of truth. The diagrams are the Mermaid sources in it.