Expand description
Recycling-list driver (docs/list.md, §10). The native list host owns scrolling + cell reuse;
Day owns row content. day-core injects a day_spec::ListSource into the backend; when the
native data-source pulls a cell, bind_row builds it once (per physical cell) and thereafter
rebinds it (one slot-write) as the cell recycles.
Re-entrancy (the crux): building a row uses BuildCx, and reactive bindings patch native
widgets; both acquire with_tree per operation. So bind_row phases the tree borrow:
with_tree (adopt cell) → build/rebind + flush_sync outside any borrow → with_tree
(lay the row out in its cell). Holding the borrow across the build would deadlock the RefCell.
Structs§
- Built
Row - A freshly built row: its
Scope(owns the row’s reactive graph) and a rebind writer that slot-writes itemindexinto the row’sItemSlotwhen the cell is recycled. - List
Delete Driver - The delete closures the
list()piece supplies (docs/list.md). Exposed to the backend asday_spec::ListDeleteby the list source adapter; also driven directly bylist_try_delete(the dayscriptdelete_rowstep and the mock probe). - List
Driver - Supplied by the
list()piece, type-erased over the item type. day-core invokes these to answer the native data-source and to build/rebind rows. - List
Reorder Driver - The reorder closures the
list()piece supplies (docs/list.md). Exposed to the backend asday_spec::ListReorderby the list source adapter; also driven directly bylist_try_reorder(the dayscriptreorderstep and the mock probe). - List
Sections Driver - The section half the
list()piece supplies (docs/list.md “Sections”): a key per item and a header builder. A header row precedes every item whose key differs from the item before. - List
Swipe Driver - The swipe-action closures the
list()piece supplies (docs/list.md). Exposed to the backend asday_spec::ListSwipeby the list source adapter; also driven directly bylist_try_swipe(the dayscriptswipe_rowstep and the mock probe).
Enums§
- Cell
Step - Whether a
bind_rowmust build a new row (fresh anchor) or rebind a recycled cell.
Functions§
- install_
list - Register a list’s driver and wire its native host’s data-source. Call after the list node and
its native handle exist (from within the piece build;
with_treeis acquired per op). - list_
reload - Tell the native list its data changed (re-query the source). Call with no borrow held.
- list_
scroll_ to_ end - list_
scroll_ to_ row - Imperatively scroll the native list so row
rowis visible (docs/list.md), realizing it if needed. Clamped to the row count; a no-op while the list is empty. Call with no borrow held. - list_
set_ editing - Enter or leave the list’s native editing mode (
ListPatch::Editing, docs/list.md). - list_
set_ selected - Programmatically sync the list’s selected rows (empty = clear selection). Applied by the toolkit without re-emitting a selection event. Call with no borrow held.
- list_
splice - Imperatively scroll the native list so its last row is fully visible (chat “stick to bottom”).
A no-op while the list is empty. Call with no borrow held.
Row-level deltas to the native host: the animatable alternative to
list_reload, for sources that know exactly how their set changed (a live query’s maintainer does). - list_
try_ delete - Programmatically delete a list row through the same guard → commit path a native swipe takes
(docs/list.md): consult the piece’s guard, drop the row from the snapshot, defer the app’s
on_delete, and tell the native host to re-query. This is how the dayscriptdelete_rowstep and the mock probe drive deletion without a native gesture. Call with no borrow held. - list_
try_ reorder - Programmatically reorder a list row through the same guard → commit path a native drag takes
(docs/list.md): consult the piece’s guard (which may retarget), rotate the snapshot, defer the
app’s
on_reorder, and tell the native host to re-query. This is how the dayscriptreorderstep and the mock probe drive reordering without a native gesture. Returns the index the row actually landed at. Call with no borrow held. - list_
try_ swipe - Programmatically run a swipe action through the same offer → commit path a native gesture
takes (docs/list.md): pull the row’s offer for the edge, refuse when the action is not in
it, and defer the commit. This is how the dayscript
swipe_rowstep and the mock probe drive the swipe path without a native gesture.expectpins the button by its label: offers are state-dependent, and a pinned step must refuse to press a different button rather than press it and complain (pressing anyway flips state the script did not mean to flip, which is how one aborted run poisons every later one). Answers the activated label. Call with no borrow held. - set_
scripted_ reorder - Route
list_try_reorderatnode(the dayscriptreorderstep) toreorder, for a piece that reorders rows with no list driver of its own.reordergets the step’sfromandtoand answers where the row landed, or why it did not move. Replaces any earlier route.