From ae3c9fe0912b690f901e4116a4f5302901d322d8 Mon Sep 17 00:00:00 2001 From: PJ Date: Sat, 15 Aug 2026 21:24:57 +0530 Subject: [PATCH] feat(folio): read the amount field into every submit window Each of the three windows asks whether the tap could have committed, off the field as the landing frame shows it. --- examples/folio/sanderling/spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/folio/sanderling/spec.ts b/examples/folio/sanderling/spec.ts index 4555255..260e291 100644 --- a/examples/folio/sanderling/spec.ts +++ b/examples/folio/sanderling/spec.ts @@ -104,6 +104,11 @@ const homeCards = oncePerFrame((s: State): CardReading[] => // the last-read Home total so `previous` and `current` stay on the same scale. const homeTotalText = (s: State) => on("home", "TotalBalance")(s)?.text; +// The amount field as the frame a submit landed on shows it, which is the form +// state that submit read. Every window below asks, because a submit the app +// must have refused raises no bound: see submitCouldCommit. +const txnAmountText = oncePerFrame((s: State) => on("add-transaction", "TxnAmountField")(s)?.text); + let lastHomeTotal: number | null = null; const totalBalance = extract("totalBalance", s => { const reading = readHomeTotalBalance({ @@ -129,6 +134,7 @@ const submitsInWindow = extract("submitsInWindow", s => { const window = countSubmitsInWindow({ previousCount: submitsSinceHomeTotal, lastAction: s.lastAction, + amountText: txnAmountText(s), fresh, }); submitsSinceHomeTotal = window.next; @@ -177,6 +183,7 @@ const submitsSinceCounts = extract("submitsSinceCounts", s => { const window = countSubmitsInWindow({ previousCount: submitsSinceHomeCards, lastAction: s.lastAction, + amountText: txnAmountText(s), fresh, }); submitsSinceHomeCards = window.next; @@ -215,6 +222,7 @@ const submitsSinceBalance = extract("submitsSinceAccountBalance", s => { const window = countSubmitsInWindow({ previousCount: submitsSinceAccountBalance, lastAction: s.lastAction, + amountText: txnAmountText(s), fresh, }); submitsSinceAccountBalance = window.next;