kaafil-react-uikit 0.11.7 → 0.11.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,33 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this package uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  While on `0.x` a minor bump may carry a breaking change; the entry will say so.
8
8
 
9
+ ## [0.11.8] — 2026-09-18
10
+
11
+ ### Fixed
12
+
13
+ - **"Spend logged" read ₹0 with the money already spent.** `ManagerMoneySection`
14
+ summed the snapshot-backed `expenses[]` rows for that tile. `useExpenses`
15
+ deliberately enqueues its writes without an optimistic row — a fabricated
16
+ `ExpenseResponse` would have to guess `floatMovementId`, `receiptRequired`
17
+ and the negative-float guard, none of which a client can compute — so a
18
+ freshly logged expense is absent from that array until a pull brings it down,
19
+ and the tile showed zero until the manager reopened the app.
20
+
21
+ The tile now reads `totals.spendTotalMinor`, the server's own spend rollup,
22
+ which the hook already re-reads on every `sync.drained`. That is also simply
23
+ more correct than summing whichever rows this device happens to hold. The
24
+ local sum stays as the offline fallback, since `spendTotalMinor` is
25
+ documented as `undefined` until a read lands and must never be drawn as zero.
26
+
27
+ ### Known
28
+
29
+ - The **Recent expenses list** on the same screen still fills only on the next
30
+ pull, for the same reason: no optimistic row, and `sync.drained` is emitted
31
+ without a pull following it. The tile above it is now correct either way.
32
+ Closing the gap properly means either fabricating a row with server-assigned
33
+ fields (rejected, above) or pulling after every drain, which is an engine-wide
34
+ change rather than a component one.
35
+
9
36
  ## [0.11.7] — 2026-09-18
10
37
 
11
38
  ### Fixed
@@ -6043,7 +6043,37 @@ function ReadyManagerMoneySection({
6043
6043
  issuedMinor: floatRow.issuedMinor,
6044
6044
  currency: floatRow.currency
6045
6045
  } : void 0,
6046
- spend: expensesReady !== void 0 ? { amountMinor: sumSpendMinor(active), currency } : void 0,
6046
+ spend: (
6047
+ /*
6048
+ * THE SERVER'S OWN ROLLUP FIRST, the local sum only as a fallback.
6049
+ *
6050
+ * This summed `active` — the snapshot-backed rows — and nothing
6051
+ * else. `useExpenses` deliberately enqueues its writes WITHOUT an
6052
+ * optimistic row (its own DECISION comment: a fabricated
6053
+ * `ExpenseResponse` would have to guess `floatMovementId`,
6054
+ * `receiptRequired` and the negative-float guard, none of which a
6055
+ * client can compute). That decision is right, and its consequence
6056
+ * is that a freshly logged expense is absent from `expenses[]` until
6057
+ * a pull brings it down — so this tile read ₹0 with the money
6058
+ * already spent, on the one screen a manager checks it on.
6059
+ *
6060
+ * `totals.spendTotalMinor` is the server's own spend rollup and the
6061
+ * hook already re-reads it on every `sync.drained`, so it reflects
6062
+ * the write as soon as the queue reaches the server. Using it here
6063
+ * is also simply more correct than summing whichever rows this
6064
+ * device happens to hold.
6065
+ *
6066
+ * The local sum stays as the fallback rather than the primary. Its
6067
+ * own doc says `spendTotalMinor` is `undefined` until a read lands
6068
+ * and must never be drawn as zero — offline, where that read cannot
6069
+ * happen, a sum of the rows actually held is the honest answer, and
6070
+ * it is what offline-first means here.
6071
+ */
6072
+ expensesReady !== void 0 ? {
6073
+ amountMinor: expensesReady.totals.spendTotalMinor ?? sumSpendMinor(active),
6074
+ currency
6075
+ } : void 0
6076
+ ),
6047
6077
  collect: collectionsReady !== void 0 ? {
6048
6078
  amountMinor: balancesDueRows.reduce((sum, row) => sum + row.outstandingMinor, 0),
6049
6079
  travellerCount: balancesDueRows.length,