From 3b3e4a221fa47d0109c6ab99be65b5ba48bae254 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sat, 26 Sep 2026 11:23:52 +0100 Subject: Count the open tasks in the todo example The left field said how many tasks there were; it now says how many are still open, "2 of 3", with aup's count(t in tasks where !t.done), which Pure runs as a fold over the list on every surface. The reference model counts the same, and in the browser the field follows a task marked done. --- examples/todo.aup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/todo.aup') diff --git a/examples/todo.aup b/examples/todo.aup index a5ee3b0..f1e3825 100644 --- a/examples/todo.aup +++ b/examples/todo.aup @@ -29,7 +29,7 @@ on urgent.down { at.urgent = !at.urgent } on drop.down { tasks.remove(at) } view title = "To do" -view left = "{tasks.count} tasks" +view left = "{count(t in tasks where !t.done)} of {tasks.count}" # A list: label, and optionally tone, badge and detail per row. view tasks_list = each task in tasks { -- cgit v1.2.3