From 0d5effd6afe8808296a01db102ca4c247cdcd1af Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sat, 26 Sep 2026 11:33:31 +0100 Subject: Show filtered lists and their shared focus A list may now be filtered (each t in tasks where !t.done), and several filtered lists over one list share one focus: the focus view names an item, so Vega asks Pure which row shows it and highlights it only in the list that holds it; the other lists have no focus (null in the web surface's JSON, and the spoken surface names the item where it is). A click or point on a row points at the item that row shows, and the wheel on a list without the focus focuses the row under it. Pure's rows now take a mutable app. examples/today.aup shows what is open and what is done; its CLI output matches a model over random adds, moves, toggles and points into either list, and the web surface leaves the other list without a focus. --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 46b672f..b9ea91e 100644 --- a/src/main.c +++ b/src/main.c @@ -95,8 +95,10 @@ static bool mouse(unsigned button, unsigned line) { const VegaPart *part = &screen.parts[index]; if (button == 64 || button == 65) { size_t focus = vega_focus(&app, part), rows = vega_rows(&app, part); - if (button == 64 ? !focus : focus + 1 >= rows) return false; - item = button == 64 ? focus - 1 : focus + 1; + if (focus < rows) { /* else the wheel focuses the row under it */ + if (button == 64 ? !focus : focus + 1 >= rows) return false; + item = button == 64 ? focus - 1 : focus + 1; + } } else if (button) return false; return vega_point(&app, part, item); } -- cgit v1.2.3