Skip to content

Commit 6c8ff47

Browse files
committed
feat(health-report-decoder): add health icons and improve UI styling
Add 5 new health-themed SVG icons for the health report decoder feature: - gym, medicine-bottle, i-utensils, medical-records, fever and psychology icons Update two artifact block components: 1. SystemIgnitionBlock: add text styling and semantic markup for better readability 2. TravelNotesBlock: add styled text highlights and updated caption text Add dynamic icon rendering to LifeContextBlock to show relevant icons for each health context field Improve layout responsiveness and styling for ReportTriageBlock including better table handling and text formatting
1 parent 6bd836c commit 6c8ff47

10 files changed

Lines changed: 100 additions & 30 deletions

File tree

agent-html/artifacts/health-report-decoder/life-context.block.tsx

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,53 @@ import {
1111

1212
import { lifeContextFields } from "./data"
1313

14+
const lifeContextIconByLabel: Record<string, { label: string; src: string }> = {
15+
家庭病史: {
16+
label: "病史记录图标",
17+
src: "/__agent-html/public/health-report-decoder/healthicons/medical-records.svg",
18+
},
19+
近期感染: {
20+
label: "发热感染图标",
21+
src: "/__agent-html/public/health-report-decoder/healthicons/fever.svg",
22+
},
23+
睡眠与压力: {
24+
label: "心理压力图标",
25+
src: "/__agent-html/public/health-report-decoder/healthicons/psychology.svg",
26+
},
27+
用药与补充剂: {
28+
label: "用药图标",
29+
src: "/__agent-html/public/health-report-decoder/healthicons/medicine-bottle.svg",
30+
},
31+
运动: {
32+
label: "运动图标",
33+
src: "/__agent-html/public/health-report-decoder/healthicons/gym.svg",
34+
},
35+
饮食与饮酒: {
36+
label: "饮食图标",
37+
src: "/__agent-html/public/health-report-decoder/healthicons/i-utensils.svg",
38+
},
39+
}
40+
41+
function LifeContextIcon({ fieldLabel }: { fieldLabel: string }) {
42+
const icon = lifeContextIconByLabel[fieldLabel]
43+
44+
if (!icon) {
45+
return null
46+
}
47+
48+
return (
49+
<span
50+
aria-label={icon.label}
51+
className="size-6 shrink-0 bg-current text-muted-foreground [mask-position:center] [mask-repeat:no-repeat] [mask-size:contain]"
52+
role="img"
53+
style={{
54+
WebkitMaskImage: `url(${icon.src})`,
55+
maskImage: `url(${icon.src})`,
56+
}}
57+
/>
58+
)
59+
}
60+
1461
export function LifeContextBlock() {
1562
return (
1663
<section className="canvas-stack-lg">
@@ -36,7 +83,12 @@ export function LifeContextBlock() {
3683
<TableBody>
3784
{lifeContextFields.map((field) => (
3885
<TableRow key={field.label}>
39-
<TableCell className="font-medium">{field.label}</TableCell>
86+
<TableCell className="font-medium">
87+
<span className="canvas-wrap-sm items-center">
88+
<LifeContextIcon fieldLabel={field.label} />
89+
{field.label}
90+
</span>
91+
</TableCell>
4092
<TableCell>{field.prompt}</TableCell>
4193
<TableCell>{field.record}</TableCell>
4294
</TableRow>

agent-html/artifacts/health-report-decoder/report-triage.block.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,27 @@ export function ReportTriageBlock() {
2828
)
2929

3030
return (
31-
<section className="canvas-stack-lg">
32-
<div className="canvas-stack-sm">
31+
<section className="canvas-stack-lg w-full">
32+
<div className="canvas-stack-sm w-full min-w-0">
3333
<div className="canvas-wrap-sm items-center">
3434
<Badge variant="secondary">体检后的小记录</Badge>
3535
<Badge variant="outline">{sampleReport.context}</Badge>
3636
</div>
3737
<h1 className="canvas-text-title">这次先记三件事。</h1>
3838
<p className="canvas-text-body text-muted-foreground">
39-
不急着给自己下结论。先把需要问、需要复查、需要下次对照的项目放在同一页。
39+
不急着给自己下结论。先把<span className="font-medium text-foreground">需要问</span>
40+
{"、"}
41+
<span className="font-medium text-warning">需要复查</span>
42+
{"、"}需要下次对照的项目放在同一页。
4043
</p>
4144
</div>
4245

43-
<div className="grid gap-6 overflow-hidden rounded-md bg-background md:grid-cols-[0.78fr_1.22fr]">
44-
<aside className="canvas-stack-md border-b md:border-b-0">
46+
<div className="grid w-full min-w-0 gap-6 overflow-hidden rounded-md bg-background md:grid-cols-[0.62fr_1.38fr]">
47+
<aside className="canvas-stack-md w-full min-w-0 border-b md:border-b-0">
4548
<div className="canvas-stack-xs">
4649
<Badge variant="secondary">这次先看</Badge>
4750
<p className="canvas-text-caption text-muted-foreground">
48-
把红箭头先变成几个可处理的事项
51+
<span className="text-destructive">红箭头</span>先变成几个可处理的事项
4952
</p>
5053
</div>
5154

@@ -61,7 +64,9 @@ export function ReportTriageBlock() {
6164
</div>
6265
<p className="canvas-text-body">{item.label}</p>
6366
<p className="canvas-text-caption text-muted-foreground">
64-
{item.result}
67+
<span className="font-mono text-foreground">
68+
{item.result}
69+
</span>
6570
{item.unit ? ` ${item.unit}` : ""} / {item.rawNote}
6671
</p>
6772
</div>
@@ -79,16 +84,17 @@ export function ReportTriageBlock() {
7984
</div>
8085
</aside>
8186

82-
<div className="canvas-stack-lg">
83-
<div className="canvas-stack-xs">
87+
<div className="canvas-stack-lg w-full min-w-0">
88+
<div className="canvas-stack-xs w-full min-w-0">
8489
<Badge variant="secondary">报告摘录</Badge>
8590
<p className="canvas-text-caption text-muted-foreground">
86-
原来的缩写、单位和参考范围保留,方便回看纸质报告。
91+
原来的<span className="font-mono text-foreground">缩写</span>
92+
{"、"}单位和参考范围保留,方便回看纸质报告。
8793
</p>
8894
</div>
8995

90-
<div className="overflow-x-auto rounded-md border bg-background">
91-
<Table>
96+
<div className="w-full min-w-0 overflow-x-auto rounded-md border bg-background">
97+
<Table className="min-w-full">
9298
<TableHeader>
9399
<TableRow>
94100
<TableHead>代码</TableHead>
@@ -102,18 +108,14 @@ export function ReportTriageBlock() {
102108
{sampleReport.labItems.map((item) => (
103109
<TableRow key={item.code}>
104110
<TableCell className="font-mono">{item.code}</TableCell>
105-
<TableCell>
106-
<span className="whitespace-nowrap">{item.label}</span>
107-
</TableCell>
111+
<TableCell>{item.label}</TableCell>
108112
<TableCell className="font-mono">
109113
{item.result}
110114
{item.unit ? (
111115
<span className="text-muted-foreground"> {item.unit}</span>
112116
) : null}
113117
</TableCell>
114-
<TableCell className="font-mono text-xs">
115-
<span className="whitespace-nowrap">{item.referenceRange}</span>
116-
</TableCell>
118+
<TableCell className="font-mono text-xs">{item.referenceRange}</TableCell>
117119
<TableCell>
118120
{item.flag ? (
119121
<StatusBadge status={statusFor(item.status).status}>
@@ -129,7 +131,7 @@ export function ReportTriageBlock() {
129131
</Table>
130132
</div>
131133

132-
<div className="canvas-grid-gap md:grid-cols-4">
134+
<div className="canvas-grid-gap w-full min-w-0 sm:grid-cols-2">
133135
{statusOrder.map((status) => {
134136
const meta = statusMeta[status]
135137
const items = labItemsByStatus(status)

agent-html/artifacts/nasa-artemis-ii/system-ignition.block.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ export function SystemIgnitionBlock() {
4040
<StatusBadge status="warning">system ignition</StatusBadge>
4141
</div>
4242
<h2 className="canvas-text-heading">
43-
A full deep-space system came alive from the ground.
43+
A full <span className="text-ring">deep-space system</span> came
44+
alive from the ground.
4445
</h2>
4546
<p className="canvas-text-body text-muted-foreground">
46-
SLS, flame, smoke, tower structure, and mission environment appear
47-
together. Launch is the entry point to the system, not the whole
48-
story.
47+
<span className="font-mono text-foreground">SLS</span>, flame,
48+
smoke, tower structure, and mission environment appear together.{" "}
49+
<strong className="font-medium text-foreground">Launch</strong> is
50+
the entry point to the system, not the whole story.
4951
</p>
5052
</div>
5153

@@ -57,7 +59,7 @@ export function SystemIgnitionBlock() {
5759
<article className="canvas-stack-xs" key={panel.label}>
5860
<p className="canvas-wrap-sm items-center canvas-text-body">
5961
<Icon data-icon="inline-start" />
60-
<span>{panel.label}</span>
62+
<span className="font-medium">{panel.label}</span>
6163
</p>
6264
<p className="canvas-text-caption text-muted-foreground">
6365
{panel.summary}

agent-html/artifacts/tokyo-three-speeds/travel-notes.block.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ export function TravelNotesBlock() {
6767
A useful Tokyo day is not the one that proves the most.
6868
</h2>
6969
<p className="canvas-text-body text-muted-foreground">
70-
Day 3 works best as a travel note instead of a checklist. Pick one
71-
anchor, let the route stay short, and treat unfinished places as part
72-
of the design rather than a failure of planning.
70+
<span className="text-foreground">Day 3</span> works best as a travel
71+
note instead of a checklist. Pick{" "}
72+
<strong className="font-medium text-foreground">one anchor</strong>,
73+
let the route stay short, and treat{" "}
74+
<em className="text-foreground">unfinished places</em> as part of the
75+
design rather than a failure of planning.
7376
</p>
7477
</div>
7578

@@ -80,7 +83,12 @@ export function TravelNotesBlock() {
8083
</div>
8184
<figcaption className="canvas-stack-xs">
8285
<Badge variant="outline">unfinished route</Badge>
83-
<p className="canvas-text-body">{openDoodle.caption}</p>
86+
<p className="canvas-text-body">
87+
Leave one street, shelf, or garden path{" "}
88+
<em className="text-muted-foreground">unresolved</em> so the next
89+
visit already has{" "}
90+
<strong className="font-medium">a beginning</strong>.
91+
</p>
8492
</figcaption>
8593
</figure>
8694

@@ -89,7 +97,7 @@ export function TravelNotesBlock() {
8997
<article className="canvas-stack-sm border-l pl-4" key={note.label}>
9098
<p className="canvas-wrap-sm items-center canvas-text-body">
9199
<note.Icon data-icon="inline-start" />
92-
<span>{note.label}</span>
100+
<span className="font-medium">{note.label}</span>
93101
</p>
94102
<p className="canvas-text-caption text-muted-foreground">
95103
{note.text}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)