Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- AGENTS.md +3 -1
- CLAUDE.md +3 -1
- tests/test_session_evidence.js +9 -9
- web_demo/static/mobile/mobile.css +2 -2
- web_demo/static/shared/session-evidence.js +5 -2
- web_demo/static/styles.css +2 -2
AGENTS.md
CHANGED
|
@@ -252,7 +252,9 @@ median. The precise median is retained, while a half-up 0.1 mm value is used
|
|
| 252 |
for `recommend_ring_size()`; exact midpoint ties prefer the smaller size. Raw
|
| 253 |
shot fields remain unchanged. The visible result cards prefer the separate
|
| 254 |
`session_recommendation` object. A single footer below the cards reads
|
| 255 |
-
`Based on N measurements
|
|
|
|
|
|
|
| 256 |
The admin Records table preserves its raw-shot columns and adds a separate
|
| 257 |
`Session Recommendation` summary column with an on-demand JSON view; legacy
|
| 258 |
rows display `—` in that column.
|
|
|
|
| 252 |
for `recommend_ring_size()`; exact midpoint ties prefer the smaller size. Raw
|
| 253 |
shot fields remain unchanged. The visible result cards prefer the separate
|
| 254 |
`session_recommendation` object. A single footer below the cards reads
|
| 255 |
+
`Based on N measurements of your right/left hand. (For best reliability, take
|
| 256 |
+
at least 3 measurements using the same hand.)` The line is left-aligned on
|
| 257 |
+
both web surfaces and matches the following feedback hint's `0.95rem` size.
|
| 258 |
The admin Records table preserves its raw-shot columns and adds a separate
|
| 259 |
`Session Recommendation` summary column with an on-demand JSON view; legacy
|
| 260 |
rows display `—` in that column.
|
CLAUDE.md
CHANGED
|
@@ -252,7 +252,9 @@ median. The precise median is retained, while a half-up 0.1 mm value is used
|
|
| 252 |
for `recommend_ring_size()`; exact midpoint ties prefer the smaller size. Raw
|
| 253 |
shot fields remain unchanged. The visible result cards prefer the separate
|
| 254 |
`session_recommendation` object. A single footer below the cards reads
|
| 255 |
-
`Based on N measurements
|
|
|
|
|
|
|
| 256 |
The admin Records table preserves its raw-shot columns and adds a separate
|
| 257 |
`Session Recommendation` summary column with an on-demand JSON view; legacy
|
| 258 |
rows display `—` in that column.
|
|
|
|
| 252 |
for `recommend_ring_size()`; exact midpoint ties prefer the smaller size. Raw
|
| 253 |
shot fields remain unchanged. The visible result cards prefer the separate
|
| 254 |
`session_recommendation` object. A single footer below the cards reads
|
| 255 |
+
`Based on N measurements of your right/left hand. (For best reliability, take
|
| 256 |
+
at least 3 measurements using the same hand.)` The line is left-aligned on
|
| 257 |
+
both web surfaces and matches the following feedback hint's `0.95rem` size.
|
| 258 |
The admin Records table preserves its raw-shot columns and adds a separate
|
| 259 |
`Session Recommendation` summary column with an on-demand JSON view; legacy
|
| 260 |
rows display `—` in that column.
|
tests/test_session_evidence.js
CHANGED
|
@@ -10,29 +10,29 @@ const source = fs.readFileSync(
|
|
| 10 |
|
| 11 |
function loadHelper() {
|
| 12 |
const window = {};
|
| 13 |
-
vm.runInNewContext(source, { window, Number, Object });
|
| 14 |
return window.SessionEvidence;
|
| 15 |
}
|
| 16 |
|
| 17 |
-
test("formats singular
|
| 18 |
const helper = loadHelper();
|
| 19 |
assert.equal(
|
| 20 |
-
helper.text({ successful_shots: 1 }),
|
| 21 |
-
"Based on 1 measurement. (
|
| 22 |
);
|
| 23 |
});
|
| 24 |
|
| 25 |
-
test("uses the session shot count and
|
| 26 |
const helper = loadHelper();
|
| 27 |
assert.equal(
|
| 28 |
-
helper.text({ successful_shots: 3 }),
|
| 29 |
-
"Based on 3 measurements. (
|
| 30 |
);
|
| 31 |
});
|
| 32 |
|
| 33 |
-
test("falls back to per-finger counts
|
| 34 |
const helper = loadHelper();
|
| 35 |
assert.equal(helper.text({ per_finger: { index: { sample_count: 2 } } }),
|
| 36 |
-
"Based on 2 measurements. (
|
| 37 |
assert.equal(helper.text({ per_finger: {} }), "");
|
| 38 |
});
|
|
|
|
| 10 |
|
| 11 |
function loadHelper() {
|
| 12 |
const window = {};
|
| 13 |
+
vm.runInNewContext(source, { window, Number, Object, String });
|
| 14 |
return window.SessionEvidence;
|
| 15 |
}
|
| 16 |
|
| 17 |
+
test("formats singular left-hand evidence and guidance", () => {
|
| 18 |
const helper = loadHelper();
|
| 19 |
assert.equal(
|
| 20 |
+
helper.text({ successful_shots: 1, handedness: "Left" }),
|
| 21 |
+
"Based on 1 measurement of your left hand. (For best reliability, take at least 3 measurements using the same hand.)",
|
| 22 |
);
|
| 23 |
});
|
| 24 |
|
| 25 |
+
test("uses the session shot count and identifies the right hand", () => {
|
| 26 |
const helper = loadHelper();
|
| 27 |
assert.equal(
|
| 28 |
+
helper.text({ successful_shots: 3, handedness: "Right" }),
|
| 29 |
+
"Based on 3 measurements of your right hand. (For best reliability, take at least 3 measurements using the same hand.)",
|
| 30 |
);
|
| 31 |
});
|
| 32 |
|
| 33 |
+
test("falls back to per-finger counts without inventing a hand", () => {
|
| 34 |
const helper = loadHelper();
|
| 35 |
assert.equal(helper.text({ per_finger: { index: { sample_count: 2 } } }),
|
| 36 |
+
"Based on 2 measurements. (For best reliability, take at least 3 measurements using the same hand.)");
|
| 37 |
assert.equal(helper.text({ per_finger: {} }), "");
|
| 38 |
});
|
web_demo/static/mobile/mobile.css
CHANGED
|
@@ -772,8 +772,8 @@ body {
|
|
| 772 |
}
|
| 773 |
|
| 774 |
.finger-count {
|
| 775 |
-
text-align:
|
| 776 |
-
font-size: 0.
|
| 777 |
color: var(--ink-soft);
|
| 778 |
margin-top: 8px;
|
| 779 |
margin-bottom: 12px;
|
|
|
|
| 772 |
}
|
| 773 |
|
| 774 |
.finger-count {
|
| 775 |
+
text-align: left;
|
| 776 |
+
font-size: 0.95rem;
|
| 777 |
color: var(--ink-soft);
|
| 778 |
margin-top: 8px;
|
| 779 |
margin-bottom: 12px;
|
web_demo/static/shared/session-evidence.js
CHANGED
|
@@ -23,9 +23,12 @@
|
|
| 23 |
const count = measurementCount(payload);
|
| 24 |
if (!count) return "";
|
| 25 |
const noun = count === 1 ? "measurement" : "measurements";
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
|
| 29 |
global.SessionEvidence = { measurementCount, text };
|
| 30 |
})(window);
|
| 31 |
-
|
|
|
|
| 23 |
const count = measurementCount(payload);
|
| 24 |
if (!count) return "";
|
| 25 |
const noun = count === 1 ? "measurement" : "measurements";
|
| 26 |
+
const handedness = String(payload && payload.handedness || "").toLowerCase();
|
| 27 |
+
const hand = handedness === "left" || handedness === "right"
|
| 28 |
+
? ` of your ${handedness} hand`
|
| 29 |
+
: "";
|
| 30 |
+
return `Based on ${count} ${noun}${hand}. (For best reliability, take at least 3 measurements using the same hand.)`;
|
| 31 |
}
|
| 32 |
|
| 33 |
global.SessionEvidence = { measurementCount, text };
|
| 34 |
})(window);
|
|
|
web_demo/static/styles.css
CHANGED
|
@@ -525,8 +525,8 @@ pre {
|
|
| 525 |
}
|
| 526 |
|
| 527 |
.finger-count {
|
| 528 |
-
text-align:
|
| 529 |
-
font-size: 0.
|
| 530 |
color: var(--ink-soft);
|
| 531 |
}
|
| 532 |
|
|
|
|
| 525 |
}
|
| 526 |
|
| 527 |
.finger-count {
|
| 528 |
+
text-align: left;
|
| 529 |
+
font-size: 0.95rem;
|
| 530 |
color: var(--ink-soft);
|
| 531 |
}
|
| 532 |
|