mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
style(coach): drop redundant per-row source labels in evidence disclosure
Each row in "What I'm looking at" / "Worauf bezieht sich das?" was prefixed with `kv.label` — the same framing the disclosure heading already supplies. The label is gone; rows lead with the value + unit and keep the window as a parenthetical tail.
This commit is contained in:
1 parent
1895fd3cd8
commit
4c9c0687b5
2 files changed
+16
-8
No files matched your search
@@ -304,10 +304,13 @@ describe("<MessageThread>", () => {
|
||||
expect(html).toContain('data-slot="coach-evidence-list"');
|
||||
const rows = (html.match(/data-slot="coach-evidence-row"/g) ?? []).length;
|
||||
expect(rows).toBe(2);
|
||||
expect(html).toContain("avg7 systolic");
|
||||
// v1.4.25 W5 — per-row source labels were dropped. The values +
|
||||
// units + window framing stay; the redundant `kv.label` prefix
|
||||
// (e.g. "avg7 systolic:") does not appear.
|
||||
expect(html).not.toContain("avg7 systolic");
|
||||
expect(html).not.toContain("avg30 systolic");
|
||||
expect(html).toContain("138 mmHg");
|
||||
expect(html).toContain("(last7days)");
|
||||
expect(html).toContain("avg30 systolic");
|
||||
expect(html).toContain("134 mmHg");
|
||||
// Disclosure is collapsed by default (no `open` attribute).
|
||||
expect(html).not.toMatch(/<details[^>]*\bopen\b/);
|
||||
@@ -355,11 +358,11 @@ describe("<MessageThread>", () => {
|
||||
],
|
||||
};
|
||||
const html = render(<MessageThread conversation={withKeyValues} />);
|
||||
expect(html).toContain("30-day adherence");
|
||||
// No stray empty unit/window markup.
|
||||
expect(html).not.toMatch(
|
||||
/30-day adherence:\s*<\/span>\s*<strong[^>]*>\s*</,
|
||||
);
|
||||
// v1.4.25 W5 — `kv.label` no longer renders; only the value
|
||||
// bubbles up. The row still mounts so the value is visible.
|
||||
expect(html).not.toContain("30-day adherence");
|
||||
expect(html).toContain('data-slot="coach-evidence-row"');
|
||||
expect(html).toMatch(/<strong[^>]*>\s*96\s*<\/strong>/);
|
||||
});
|
||||
|
||||
it("hides the disclosure entirely when keyValues is empty or absent", () => {
|
||||
|
||||
@@ -427,7 +427,12 @@ function ChatBubble({
|
||||
data-slot="coach-evidence-row"
|
||||
className="leading-relaxed"
|
||||
>
|
||||
<span className="text-muted-foreground">{kv.label}:</span>{" "}
|
||||
{/* v1.4.25 W5 — `kv.label` (e.g. "avg7 systolic")
|
||||
was rendered prefixed to every row, repeating
|
||||
framing the disclosure heading already gives.
|
||||
Drop the label and lead with the value; the
|
||||
window stays as a parenthetical tail so the row
|
||||
still answers "over what timeframe?". */}
|
||||
<strong className="font-semibold">
|
||||
{kv.value}
|
||||
{kv.unit ? ` ${kv.unit}` : ""}
|
||||
|
||||
Reference in new issue
Block a user