Skip to content

Commit 3fafa16

Browse files
committed
fix(overview): polish scorecard accessibility
中文:完善总览评分页的可访问性与视觉细节。
1 parent 1b93b2a commit 3fafa16

3 files changed

Lines changed: 39 additions & 31 deletions

File tree

packages/app/cypress/e2e/overview.cy.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,28 @@ describe('Executive overview', () => {
1515
});
1616
});
1717

18+
it('labels unavailable scorecard values for assistive technology', () => {
19+
cy.visit('/overview');
20+
cy.contains('tr', 'GLM5.2').within(() => {
21+
cy.contains('No 8K/1K single-turn data').should('exist');
22+
cy.get('td').eq(1).should('contain.text', 'Weighted score unavailable');
23+
cy.get('td').eq(6).should('contain.text', 'Runner-up comparison unavailable');
24+
cy.get('td').eq(7).should('contain.text', 'Freshness unavailable');
25+
});
26+
});
27+
1828
it('shows a truthful empty state and a tracked detail link', () => {
1929
cy.visit('/overview');
2030
cy.contains('tr', 'GLM5.2').should('contain.text', 'No 8K/1K single-turn data');
2131
cy.contains('tr', 'Qwen3.5')
2232
.find('a[href^="/inference?"]')
2333
.should('have.attr', 'href')
2434
.and('include', 'i_seq=8k%2F1k');
25-
cy.contains('tr', 'Qwen3.5').should('contain.text', 'Standard decode fallback');
35+
cy.contains('tr', 'Qwen3.5')
36+
.should('contain.text', 'Standard decode fallback')
37+
.and('contain.text', '†')
38+
.and('not.contain.text', '30:')
39+
.and('not.contain.text', '100:');
2640
cy.get('[data-testid="overview-scorecard"]').should('contain.text', '—');
2741
cy.get('[data-testid="overview-scorecard"]').should('contain.text', '†');
2842
cy.get('[data-testid="overview-scorecard"] time').first().should('have.attr', 'datetime');
@@ -48,7 +62,12 @@ describe('Executive overview', () => {
4862
cy.visit('/zh/overview');
4963
cy.contains('h1', 'AI 推理高管总览').should('exist');
5064
cy.get('[data-testid="language-toggle"]').should('have.attr', 'href', '/overview');
51-
cy.contains('tr', 'GLM5.2').should('contain.text', '暂无 8K/1K 单轮基准测试数据');
65+
cy.contains('tr', 'GLM5.2').within(() => {
66+
cy.contains('暂无 8K/1K 单轮基准测试数据').should('exist');
67+
cy.get('td').eq(1).should('contain.text', '暂无加权评分');
68+
cy.get('td').eq(6).should('contain.text', '暂无第二名对比');
69+
cy.get('td').eq(7).should('contain.text', '暂无数据日期');
70+
});
5271
cy.contains('加权评分').should('exist');
5372
cy.contains('第一名').should('exist');
5473
});

packages/app/cypress/fixtures/api/overview.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"decodeLabel": "MTP",
242242
"score": 1010,
243243
"tierValues": [
244-
{ "tier": 30, "value": 1200, "boundary": "interpolated" },
244+
{ "tier": 30, "value": 1200, "boundary": "clamped_low" },
245245
{ "tier": 50, "value": 1000, "boundary": "interpolated" },
246246
{ "tier": 75, "value": 800, "boundary": "interpolated" },
247247
{ "tier": 100, "value": 600, "boundary": "interpolated" }
@@ -275,7 +275,7 @@
275275
"decodeLabel": "MTP",
276276
"score": 1010,
277277
"tierValues": [
278-
{ "tier": 30, "value": 1200, "boundary": "interpolated" },
278+
{ "tier": 30, "value": 1200, "boundary": "clamped_low" },
279279
{ "tier": 50, "value": 1000, "boundary": "interpolated" },
280280
{ "tier": 75, "value": 800, "boundary": "interpolated" },
281281
{ "tier": 100, "value": 600, "boundary": "interpolated" }

packages/app/src/components/overview/overview-page.tsx

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ const STRINGS = {
3636
detailLink: 'View details',
3737
caption: 'Executive scorecard comparing the best serving platform for each active AI model.',
3838
scrollRegion: 'Scrollable executive inference scorecard',
39-
unavailableSr: 'No reachable result at this tier',
39+
missingPageDateSr: 'Latest official data date unavailable',
40+
missingWeightedScoreSr: 'Weighted score unavailable',
41+
missingRunnerUpSr: 'Runner-up comparison unavailable',
42+
missingFreshnessSr: 'Freshness unavailable',
43+
unavailableTierSr: 'No reachable result at this tier',
4044
clampedSr: 'Value clamped to the lowest observed interactivity point',
4145
},
4246
zh: {
@@ -63,7 +67,11 @@ const STRINGS = {
6367
detailLink: '查看详情',
6468
caption: '对比每个活跃 AI 模型最佳服务平台的高管评分表。',
6569
scrollRegion: '可横向滚动的 AI 推理高管评分表',
66-
unavailableSr: '此档位无可达结果',
70+
missingPageDateSr: '暂无最新官方数据日期',
71+
missingWeightedScoreSr: '暂无加权评分',
72+
missingRunnerUpSr: '暂无第二名对比',
73+
missingFreshnessSr: '暂无数据日期',
74+
unavailableTierSr: '此档位无可达结果',
6775
clampedSr: '该值采用已观测到的最低交互性数据点',
6876
},
6977
} as const;
@@ -89,7 +97,7 @@ function TierValue({
8997
strings: OverviewStrings;
9098
}) {
9199
if (!tierValue || tierValue.value === null || tierValue.boundary === 'unreachable') {
92-
return <UnavailableValue label={strings.unavailableSr} />;
100+
return <UnavailableValue label={strings.unavailableTierSr} />;
93101
}
94102

95103
return (
@@ -165,7 +173,7 @@ export function ExecutiveOverviewPage({ data, locale }: OverviewPageProps) {
165173
{data.latestDate ? (
166174
<time dateTime={data.latestDate}>{formatDate(data.latestDate, locale)}</time>
167175
) : (
168-
<UnavailableValue label={t.unavailableSr} />
176+
<UnavailableValue label={t.missingPageDateSr} />
169177
)}
170178
</p>
171179
</div>
@@ -237,7 +245,7 @@ export function ExecutiveOverviewPage({ data, locale }: OverviewPageProps) {
237245
>
238246
<th
239247
scope="row"
240-
className="sticky left-0 z-10 bg-card px-4 py-4 text-left align-top font-semibold transition-colors after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border group-hover:bg-muted/30 group-focus-within:bg-muted/30 motion-reduce:transition-none lg:px-6"
248+
className="sticky left-0 z-10 bg-card px-4 py-4 text-left align-top font-semibold transition-colors after:absolute after:inset-y-0 after:right-0 after:w-px after:bg-border group-hover:bg-muted group-focus-within:bg-muted motion-reduce:transition-none lg:px-6"
241249
>
242250
{model.modelLabel}
243251
</th>
@@ -266,25 +274,6 @@ export function ExecutiveOverviewPage({ data, locale }: OverviewPageProps) {
266274
{standardFallback && standardFallback !== winner ? (
267275
<p className="text-xs leading-relaxed text-muted-foreground">
268276
{t.standardFallback}: {standardFallback.hardwareLabel}
269-
{standardFallback.tierValues.some(
270-
(value) => value.boundary !== 'interpolated',
271-
) ? (
272-
<span className="mt-0.5 block tabular-nums">
273-
{standardFallback.tierValues
274-
.filter((value) => value.boundary !== 'interpolated')
275-
.map((value, index) => (
276-
<span key={value.tier} className="whitespace-nowrap">
277-
{index > 0 ? ' · ' : ''}
278-
{value.tier}:{' '}
279-
<TierValue
280-
tierValue={value}
281-
numberFormatter={numberFormatter}
282-
strings={t}
283-
/>
284-
</span>
285-
))}
286-
</span>
287-
) : null}
288277
</p>
289278
) : null}
290279
</div>
@@ -296,7 +285,7 @@ export function ExecutiveOverviewPage({ data, locale }: OverviewPageProps) {
296285
{winner ? (
297286
numberFormatter.format(winner.score)
298287
) : (
299-
<UnavailableValue label={t.unavailableSr} />
288+
<UnavailableValue label={t.missingWeightedScoreSr} />
300289
)}
301290
</td>
302291
{OVERVIEW_TIERS.map((tier) => (
@@ -310,7 +299,7 @@ export function ExecutiveOverviewPage({ data, locale }: OverviewPageProps) {
310299
))}
311300
<td className="px-4 py-4 text-right align-top tabular-nums">
312301
{model.runnerUpGapPercent === null ? (
313-
<UnavailableValue label={t.unavailableSr} />
302+
<UnavailableValue label={t.missingRunnerUpSr} />
314303
) : locale === 'zh' ? (
315304
`较第二名高 ${numberFormatter.format(model.runnerUpGapPercent)}%`
316305
) : (
@@ -323,7 +312,7 @@ export function ExecutiveOverviewPage({ data, locale }: OverviewPageProps) {
323312
{formatDate(winner.latestDate, locale)}
324313
</time>
325314
) : (
326-
<UnavailableValue label={t.unavailableSr} />
315+
<UnavailableValue label={t.missingFreshnessSr} />
327316
)}
328317
</td>
329318
<td className="px-4 py-4 text-right align-top">

0 commit comments

Comments
 (0)