M3 contract: the List and Board surfaces
This file is the contract for the two M3 tracks: the List surface and the Board surface, both in @ember-lattice/ember.
Summary
Date: 2026-12-01. This file is the contract for the two M3 tracks: the List surface and the
Board surface, both in @ember-lattice/ember. It follows the M2 contract
(docs/m2-grid-contract.md) for tokens, class names and test rules. To change this contract,
change this file first and say so in the report.
Sources: plan sections 4.7 and decision 18 (variable-height rows, masonry and card grids, boards, two-way infinite lists), ADR 0002 (sticky slots), ADR 0003 (scaled scroll).
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
1. List
<LatticeList
@items={{this.messages}}
{{! an array; or @table, to list the rows of a Lattice table }}
@label='Messages'
{{! required: the accessible name }}
@role='list'
{{! "list" (default) | "feed" | "listbox" }}
@getItemId={{this.id}}
{{! required with @items }}
@estimateSize={{64}}
{{! px; rows are measured after render }}
@lanes={{1}}
{{! > 1: masonry (each item goes to the shortest lane) }}
@layout='rows'
{{! "rows" (default) | "cards": equal-width cards, lanes from the width }}
@minCardWidth={{240}}
{{! px, for "cards" }}
@anchor='start'
{{! "start" | "end": "end" keeps the view at the bottom (chat) }}
@onLoadMore={{this.older}}
{{! called near the end; returns a promise }}
@onLoadPrevious={{this.newer}}
{{! called near the start; returns a promise }}
@selection={{this.selected}}
{{! listbox only: a Set of ids }}
@onSelectionChange={{this.select}}
as |item index|
>
<MessageCard @message={{item}} />
</LatticeList>
- Items are measured with a
ResizeObserver(TanStack VirtualmeasureElement, already ported in@ember-lattice/virtual). - Prepend keeps the view still: when items are added at the start, the scroll position moves by their height, so the visible item does not move (the "prepend hold" in virtual-core).
@anchor="end"starts at the bottom and stays at the bottom when new items arrive, unless the user has scrolled up.- Load more and load previous: the list calls each function once at a time. While a call is
in progress, the list sets
aria-busy="true"and shows a loading row.
DOM
Changes from the List track (2026-12-01, accepted): a div.lt-list-root wrapper holds the
role element and the loading rows (axe rejects role=status inside a list). Items carry
data-index (the measurement needs it) and are keyed by ID (no slot pool). New args:
@multiselect, @overscan. A feed item marks its title with data-lt-item-title.
aria-setsize is the number of loaded items. ListHarness.named(env, label, role). The
theme defines the --lt-* tokens on .lt-list-root too.
div.lt-list-root no role; holds the list and the loading rows
div.lt-list role=list|feed|listbox aria-label aria-busy? aria-multiselectable?
data-lt-layout=rows|cards
div.lt-list-scroller the scroll container; no tabindex
div.lt-list-sizer block-size = total height
div.lt-list-item role=listitem|article|option aria-posinset aria-setsize
aria-selected? (listbox) data-item-id data-lane?
style="transform: translateY(<px>); inset-inline-start: <lane offset>"
div.lt-list-loading role=status data-edge=start|end outside the role element
feedfollows the APG feed pattern: PageDown and PageUp move between articles, and each article hastabindex=0andaria-labelledbyits title when the item gives one.listboxfollows the APG listbox pattern: one tab stop, arrows, Home, End, typeahead (Joinerytypeahead.ts), Space to select, Shift+arrows to extend in multi-select.listhas no keyboard model of its own. Its items hold their own focusable content.- Items keep their element while in range (sticky slots, ADR 0002 amendment 1).
2. Board
<LatticeBoard
@items={{this.issues}}
@label='Issues by status'
@getItemId={{this.id}}
@lanes={{this.statuses}}
{{! the lane keys, in order, for example real-enum values }}
@laneOf={{this.statusOf}}
{{! item => lane key }}
@laneLabel={{this.statusLabel}}
{{! lane key => label }}
@onMove={{this.move}}
{{! (item, toLane, toIndex, fromLane) => void | Promise<void> }}
@estimateSize={{88}}
as |item|
>
<IssueCard @issue={{item}} />
</LatticeBoard>
- Each lane is a virtualized
LatticeListwith@role="listbox". - A move is an edit. The board calls
@onMove. It does not change@itemsitself. The app (or, from M4, the data source) changes the data. While the promise is in progress, the card shows the new place (optimistic). If the promise rejects, the card goes back and the board announces the failure.
DOM
div.lt-board role=region aria-label
div.lt-board-lane role=group aria-labelledby=<lane title id> data-lane
div.lt-board-lane-title role=heading aria-level=@headingLevel (default 3) id label and count
div.lt-list role=listbox aria-label=<lane label> (the List DOM, section 1)
div.lt-board-live aria-live=assertive class=visually hidden move announcements
div.lt-board-drag-preview aria-hidden=true the card under the pointer
Moves: pointer and keyboard
- Pointer: press on a card and move 4 px or more to start a drag. The drop place shows as a
line between cards. Drop calls
@onMove. Escape cancels. A lane scrolls when the pointer is near its top or bottom edge. Use pointer capture (Joineryresizablehas the drag code). - Keyboard (the APG "drag and drop" advice): on a focused card, Space picks it up and
announces "Picked up
. Use the arrow keys to move it." ArrowUp and ArrowDown move it in the lane. ArrowLeft and ArrowRight move it to the next lane (swap in RTL). Space drops it. Escape cancels. Each step is announced in .lt-board-live.
4. Harnesses
Add to @ember-lattice/test-support: ListHarness (itemCount(), renderedItemIds(),
item(id), scrollToItem(id), scrollToEnd(), isBusy(), selectedIds()) and
BoardHarness (lanes(), lane(key), cardsIn(key), drag(cardId, toLane, toIndex),
keyboardMove(cardId, keys), announcement()). They read only this DOM and ARIA.
6. Board changes from the Board track (2026-12-01, accepted)
- More DOM:
.lt-board-drop-linein the lane (itsinset-block-startis inline), a.lt-board-cardwrapper in each option,.lt-board-lane-count(so the lane group name includes the count), anddata-picked-upon the option of a picked-up card. toIndexis the index after the card leaves its old place.- Enter also drops a card. The board announces each step, the drop, a cancel and a failure.
- A keyboard move to another lane puts the card at its height in the view of that lane.
- If
@onMovethrows, the board acts as for a reject, then throws the error again. BoardHarness.lane(key)returns aPromise<ListHarness>.keyboardMovesends the keys exactly as given (the caller includes the Space keys).- A keyboard move cancels when the focus goes to an element out of the board (Tab), when the
user presses the pointer out of the board, and when the card is not in
@itemsafter a change. The card goes back, and the board announces the cancel. It does not move the focus. .lt-board-cardhas an inlinetouch-action: none: a touch pan on a card starts a drag.@cardLabel(item => string) gives the card name in the announcements. The default is the card text.- Open items: none.
User interface and prior art
3. Theme
The theme track adds list and board rules after these surfaces exist. Until then, each
surface's tests load the structural CSS that they need from a file in test-app/app/list/ or
test-app/app/board/. Use the M2 tokens (--lt-*) and the .lt-* class names above, so the
theme can take over the rules.
Requirements
5. Tests
- TDD: write each test first and see it fail.
- Every render test ends with an axe audit, and checks that axe checked nodes (not 0).
- Perf (not a gate yet): 100k variable-height items, 50 jumps; a board with 10 lanes × 10k cards, one drag. Report the numbers.
Data model and API changes
Not recorded in the original plan.
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/m3-list-board-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/m3-list-board-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/m3-list-board-contract.md to this page. The text is the text of the Markdown file. |
| 2026-12-04 | Joe Gaudet (agent) | Status Shipped: the List and Board surfaces of this contract are 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.