Architecture decision record · ADR-0013

Grid UI (milestone M7, part 1)

Each filter value is a FilterNode. The text, number, date, set and multi filters write a protocol tree as the column filter value, with the column ID in each leaf.

Status
Accepted
Deciders
Joe Gaudet
Created
Updated
PRD
PRD
Related
None

Context

Decision 27 of the plan puts all of the AG Grid chrome in 1.0: menus, tool panels, all filters, the status bar, the toolbar and find (research section 4.1). Another track edits the Grid at the same time, so this part does not change LatticeGrid. The engine is the table-core port: column filters with registered filter functions, faceting, a global filter, visibility, order, pin and grouping. The protocol has one filter tree, FilterNode, that a server can read.

Decision drivers

Not recorded in the original ADR.

Options considered

Not recorded in the original ADR.

Decision

  1. Each filter value is a FilterNode. The text, number, date, set and multi filters write a protocol tree as the column filter value, with the column ID in each leaf. One filter function, filterFn_node (registered as node), applies all of them. The app can send the AND of the column filters to a server with no change.
  2. The client uses the protocol row test. @ember-lattice/protocol exports matchesFilter(node, row, allowList), and evaluate calls it. The node filter function makes a plain row of the columns in the tree, and an allow-list from meta.latticeUi.filter. It changes a Date to an ISO string. A test puts the same rows through evaluate and through the table filter, and gets the same rows.
  3. The quick filter and the advanced filter share the global filter. The filtered row model has no table-level predicate, and a column filter needs a real column. The global filter value is { quick, advanced }, and globalFilterFn returns "the column holds the quick text, and the tree keeps the row". The engine ORs this over the columns, so the result is "one column holds the text, and the tree keeps the row". Limit: at least one column must allow the global filter.
  4. An empty set filter stays. in [] keeps no row. The node function removes a filter only when the value is undefined. "Select all" writes undefined.
  5. The UI uses structural types. UiTable, UiColumn and UiRow name only the methods that the UI calls, as LatticeList does with ListTable. The UI works with a table of any features.
  6. Joinery primitives for each widget. The column menu is a DropdownMenu (APG menu button, not modal). Its filter opens in a Popover when the menu has closed (onCloseAutoFocus), so the focus that goes back to the button does not close it. The side bar is Tabs. The density switch is a RadioGroup. The set filter is a LatticeList listbox. Its options have aria-selected and no checkbox, because a checkbox in an option is a nested control. The columns panel is an APG tree with aria-checked on each item.
  7. No state that the engine does not have. The engine has no auto-size and no pivot, and aggregation is a column def option. So the column menu has no auto-size item, and the columns panel has a row group zone only.

Grid extension points

Done in contract section 9 (2026-12-02): the header slot (meta.lattice.header, with GridColumnMenu), the floating filter row (@floatingFilter, with GridFloatingFilter), data-find-match (@find), GridStateHandle.scrollToCell (FindBar @grid), @density, the context menu hook (@onCellContextMenu and the contextMenu block, with GridContextMenu) and the side bar region (the sideBar block).

The Grid gives a GridColumn to a slot. asUiColumn checks that it is an engine column, so the UI parts need no cast.

Consequences

Remaining work

  • The toolbar still writes data-lt-density itself when it gets @grid. An app with @density gives @onDensityChange to the toolbar and the value to the grid.
  • GridContextMenu uses the async Clipboard API. A page without clipboard permission does not copy or paste from the menu; Ctrl+C and Ctrl+V still work.
  • The floating filter row has no cell for a column that is not in the column range, as in the other rows.
  • A sort change is announced only when the user sorts from the Grid header, not from the column menu.

Consequences

  • A server row model gets the same filter tree that the client filters with.
  • A test waiter holds the quick filter debounce, so settled() waits for the write.
  • The UI has no styles of its own yet. The theme track styles the .lt-* UI classes.

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/0013-grid-ui.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/0013-grid-ui.md

Changelog

DateAuthorChange
2026-12-01Joe GaudetStatus in the Markdown file: accepted, 2026-12-01.
2026-12-03Joe GaudetCommit 7ce4af2: Lattice 1.0 (#1)
2026-12-04Joe Gaudet (agent)Converted from docs/adr/0013-grid-ui.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.