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
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 [make_source]; also driven directly bylist_try_reorder(the dayscriptreorderstep 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 - 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.
- 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_ 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_
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.