@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.
- package/package.json +2 -2
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/community-club-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/community-club-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/community-club-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/events-meetups-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/owner-lite/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/owner-lite/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/owner-lite/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/restaurant-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/retail-store-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-ask/catalog.ts +3 -4
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-hot-path.ts +5 -5
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-analytics/index.ts +6 -1
- 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.
|
|
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": "
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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
|
|
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
|
|
7
|
-
// for a POLLED chat would be cargo-culting. These four apply now
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
175
|
-
|
|
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),
|