@wix/himalaya-cli 0.989.0 → 0.991.0

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.
Files changed (34) hide show
  1. package/package.json +2 -2
  2. package/templates/beauty-salon-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  3. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  4. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  5. package/templates/community-club-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  6. package/templates/community-club-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  7. package/templates/community-club-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  8. package/templates/events-meetups-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  9. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  10. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  11. package/templates/gym-fitness-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  12. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  13. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  14. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  15. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  16. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  17. package/templates/owner-lite/tier5-src/_shared/aria-hot-path.ts +5 -5
  18. package/templates/owner-lite/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  19. package/templates/owner-lite/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  20. package/templates/podcast-creator-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  21. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  22. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  23. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  24. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  25. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  26. package/templates/restaurant-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  27. package/templates/restaurant-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  28. package/templates/restaurant-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  29. package/templates/retail-store-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  30. package/templates/retail-store-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  31. package/templates/retail-store-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
  32. package/templates/yoga-studio-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
  33. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
  34. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.989.0",
3
+ "version": "0.991.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -65,5 +65,5 @@
65
65
  "artifactId": "himalaya-cli"
66
66
  }
67
67
  },
68
- "falconPackageHash": "67a573e97c057c3bf277ed30655a7855e28d5c899c59b41eac1f3c85"
68
+ "falconPackageHash": "ebb2d80b9a686fc18878c48955d691cd014019a04d2ed731b2a431dd"
69
69
  }
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),
@@ -1,10 +1,10 @@
1
1
  // The Aria transcript's hot path — the rules it is written to, and the two
2
2
  // primitives that make them hold.
3
3
  //
4
- // Adapted from `native-apps/PERFORMANCE.md` in wix-private/aria-native-apps, which
4
+ // Adapted from the performance guide of Aria's native app, which
5
5
  // states eleven rules, each "a class of shipped regression". Most of them govern
6
- // 30 Hz streaming, which this app does not do yet (#2612), and adopting all eleven
7
- // for a POLLED chat would be cargo-culting. These four apply now (#2623):
6
+ // 30 Hz streaming, which this app does not do yet, and adopting all eleven
7
+ // for a POLLED chat would be cargo-culting. These four apply now:
8
8
  //
9
9
  // 1. NEVER RE-DERIVE THE WHOLE TRANSCRIPT PER TICK. Every poll re-reads the full
10
10
  // transcript, and turning a message into a bubble is the expensive step —
@@ -32,7 +32,7 @@
32
32
  // a POSITION, and the moment anything before it is dropped (an empty
33
33
  // placeholder, a hidden-only row, a windowed read) the same index names a
34
34
  // different message. The bubble id is also the row's stable test id
35
- // (`<screen>.msg_<id>`, invariant 27). `transcriptKeys`, `mintLocalId`.
35
+ // (`<screen>.msg_<id>`), which UI tests find it by. `transcriptKeys`, `mintLocalId`.
36
36
  //
37
37
  // 4. EVERY REPEATING CLOCK HAS AN OWNER AND STOPS ON EVERY EXIT PATH. The only
38
38
  // clock here is the reply ladder, `_poll` id `aria-turn`, and its owner is
@@ -56,7 +56,7 @@
56
56
  // drivers) and the native app's device budgets (cold start, frame time, hangs)
57
57
  // are deliberately NOT adopted here: nothing in this repo measures them for
58
58
  // Aria, and a budget nobody measures is decoration. Each rule above is pinned by
59
- // a test instead — `core/dev-server/tests/aria-hot-path.test.ts`.
59
+ // a test instead, one per rule, each asserting a count.
60
60
  //
61
61
  // Dependency-free on purpose: the tests import this file directly.
62
62
 
@@ -229,8 +229,13 @@ function total(m: WixAnalyticsMeasurement | undefined): number {
229
229
  function seriesOf(m: WixAnalyticsMeasurement | undefined): number[] {
230
230
  return (m?.values ?? []).map((v) => v.value || 0);
231
231
  }
232
+ /**
233
+ * Counts go through the same grouped formatter as money, so "1,544" sits beside
234
+ * "7,290.53" rather than "1544". The note on `fmtMoney` explains why it
235
+ * is `formatNumber` and never `toLocaleString`.
236
+ */
232
237
  function fmtInt(n: number): string {
233
- return String(Math.round(n));
238
+ return formatNumber(Math.round(n));
234
239
  }
235
240
  /**
236
241
  * NOT `toLocaleString`. That is ECMA-402, which QuickJS-ng — watchOS and Wear OS —
@@ -165,15 +165,14 @@ export function metricRowsFrom(
165
165
  // screens cannot disagree in the last digit about the same measure.
166
166
  // NO currency symbol, and that is not an omission. The Analytics
167
167
  // screen's fmtMoney is `formatNumber(round(n*100)/100)` with no symbol
168
- // (himi-owner-lite-analytics/index.ts:241). Adding one here would make
168
+ // (`fmtMoney` in himi-owner-lite-analytics/index.ts). Adding one here would make
169
169
  // the two screens render the SAME number differently — breaking the
170
170
  // reconciliation this endpoint choice exists to guarantee — and would
171
171
  // show a euro sign to a USD, GBP or ILS site. Every other money value
172
172
  // in this bundle comes from the API's own formattedAmount for that
173
173
  // same reason.
174
- value: m.money
175
- ? formatNumber(Math.round(total * 100) / 100)
176
- : String(Math.round(total)),
174
+ // Counts are grouped too, as the Analytics screen's fmtInt groups them.
175
+ value: formatNumber(m.money ? Math.round(total * 100) / 100 : Math.round(total)),
177
176
  // The same number unformatted, so orderBy:amount sorts numerically
178
177
  // rather than lexically ("9" > "1,240" as text).
179
178
  amount: String(total),