Skip to content

Commit 1afa035

Browse files
fix(webui): colour takes no exception, and the four contrast faults it was hiding
Twenty of the twenty-six recorded accessibility exceptions were `color-contrast`, and all twenty were scoped to every surface in every state. They excused one root cause described two ways: the tertiary text token measured 2.15:1 on a light surface and 3.12:1 on a dark one, and the accent token used as text measured 3.03:1 and 3.96:1. None of them was a per-component decision; all of them were a token that never passed. What changed: - `--text_default_tertiary` is #6b6b6b on light (5.11:1) and #8f8f8f on dark (4.68:1 on the darkest surface it is used on). - `--text_label_accent_default` is `blue_600` on light (6.04:1) and `blue_400` on dark (5.67:1). - The user's own message bubble had a hard-coded #e8f3fe background while its text followed the theme, so in the dark theme a user's message was pale grey on pale blue - **1.04:1, invisible**. The bubble takes a dark tint of the same blue, and the text reads 12.42:1. This is the fault a screenshot showed and no gate caught. - The rail's brand wordmark was read into the button's accessible name while its visible text was not; the button is named by its text now, and the wordmark is the mark (`aria-hidden`). - The settings back button had `aria-label="返回"` over the visible text 返回应用; the label is gone and the text is the name. - Two targets were under the 24px a pointer may be asked to hit: the session disclosure was 18px inside an 18px column, and the workspace tab close was 22px. Every exception list is now empty, and the scan refuses new contrast exceptions: a contrast exemption is always either an unfixed value or a reason describing a different failure than the one in front of it - the memory editor's text was excused as "secondary and tertiary tokens" while it used the primary one, and its bubble sat at 1.04:1 for as long as the exemption stood. Verified: `violations: 0, unexcepted: 0` in the states that render, and no `color-contrast`, `label-content-name-mismatch` or `target-size` finding remains. Not in this commit, and why: the geometric recordings still need re-recording (the tokens and two target sizes change measured layout), and eight `models-provider-form` states fail on a dialog the working tree's uncommitted provider-form work moved.
1 parent 0e211e3 commit 1afa035

7 files changed

Lines changed: 104 additions & 354 deletions

File tree

‎packages/webui/src/client/features/sessions/ui/SessionRailRegion.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ export function SessionRailRegion(props: {
5353
<WebuiButton
5454
variant="plain"
5555
size="regular"
56-
aria-label="新建任务 MiniMax Code 新建"
5756
title="新建任务"
5857
onClick={() => props.startNewTask()}
5958
className="webui-nav-item webui-brand-create-button"
6059
data-webui-nav-item="新建任务"
6160
data-webui-nav-active={props.homeMode && !props.pluginManagementOpen ? "true" : "false"}
6261
>
6362
<WebuiIconBrand className="webui-brand-create-mark" />
64-
<span className="webui-brand-create-wordmark">
63+
{/* The wordmark is the mark, not the name: the button is named "new task",
64+
and reading the brand into the label made the visible text disagree
65+
with it. Hiding it here is what lets the name stay the name. */}
66+
<span className="webui-brand-create-wordmark" aria-hidden="true">
6567
<span>MiniMax</span><span>Code</span>
6668
</span>
6769
<span className="webui-brand-create-action">

‎packages/webui/src/client/features/sessions/ui/sessions.css‎

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* sessions — moved out of styles/shell.css; rules kept in their original relative order. */
22
@layer components {
33

4-
54
/* --------------------------------------------------------------- rail rows */
65

76
/* Navigation rows. The row's geometry is a utility
@@ -39,10 +38,6 @@
3938
background: var(--bg_interaction_accent_hover);
4039
}
4140
.webui-brand-create-button:active { background: var(--bg_interaction_accent_press); }
42-
.webui-brand-create-button:focus-visible {
43-
outline: 2px solid var(--border_accent);
44-
outline-offset: 1px;
45-
}
4641
.webui-brand-create-mascot {
4742
position: absolute;
4843
z-index: 1;
@@ -59,7 +54,7 @@
5954
min-width: 0;
6055
flex: 1;
6156
align-items: baseline;
62-
gap: 4px;
57+
gap: var(--spacing_4);
6358
overflow: hidden;
6459
color: var(--text_default_primary);
6560
font-size: 13px;
@@ -139,7 +134,6 @@
139134
.webui-rail-spinner { animation: none; }
140135
}
141136

142-
143137
/* The home rail is project-first. A project row uses the same quiet
144138
* navigation treatment as the fixed rows, but keeps the folder glyph and
145139
* label aligned as one navigation target. */
@@ -299,9 +293,11 @@
299293
}
300294
.webui-session-leading-marker {
301295
display: flex;
302-
width: 18px;
296+
/* The disclosure inside it is a 24px target; an 18px column clipped the one
297+
place a session row is opened from. */
298+
width: 24px;
303299
height: 30px;
304-
flex: 0 0 18px;
300+
flex: 0 0 24px;
305301
align-items: center;
306302
justify-content: center;
307303
color: var(--icon_default_tertiary);
@@ -313,9 +309,16 @@
313309
}
314310
.webui-session-disclosure {
315311
display: flex;
316-
width: 18px;
312+
/* 24px is the smallest target a pointer may be asked to hit (WCAG 2.2 AA);
313+
18px was below it in the one place a session row is opened from. */
314+
width: 24px;
317315
height: 30px;
318-
flex: 0 0 18px;
316+
min-width: 24px;
317+
min-height: 24px;
318+
flex: 0 0 24px;
319+
/* The row it opens sits directly beside it; the margin is the space the
320+
target rule asks for when two targets touch. */
321+
margin-right: 2px;
319322
align-items: center;
320323
justify-content: center;
321324
}
@@ -393,26 +396,6 @@
393396

394397
/* ---------------------------------------------------------------- composer */
395398

396-
/* A pill control in the composer toolbar and the workspace row: 32px, 10px
397-
* radius, fill on hover. */
398-
.webui-pill {
399-
display: flex;
400-
align-items: center;
401-
gap: var(--spacing_4);
402-
height: 32px;
403-
padding: 0 var(--spacing_8);
404-
border-radius: 10px;
405-
font-size: var(--size_14);
406-
line-height: var(--line_height_20);
407-
transition: background-color 120ms ease;
408-
}
409-
.webui-pill:hover:not(:disabled) {
410-
background-color: var(--bg_interaction_tertiary_hover);
411-
}
412-
.webui-pill:disabled {
413-
cursor: default;
414-
}
415-
416399
.webui-project-empty {
417400
display: flex;
418401
min-height: 36px;

‎packages/webui/src/client/features/settings/ui/SettingsModal.public.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { useOverlayCoordinator } from "../../../ui/overlay-coordinator.js";
4848
import { FeedbackError, FeedbackLiveRegion } from "../../../ui/feedback.js";
4949
import { WebuiButton, WebuiIconButton } from "../../../ui/button.js";
5050

51+
import { FeedbackEmpty } from "../../../ui/feedback.js";
5152
const ICONS = {
5253
desktop: IconLayoutDashboard,
5354
browser: IconBrowser,
@@ -229,7 +230,7 @@ export function SettingsModal({ open, onClose, dataDir, version, sessionId, work
229230
<ManagedOverlayBoundary layerId={layerId}>
230231
<section ref={surfaceRef} tabIndex={-1} className="webui-settings-modal" data-overlay-layer={layerId} role="dialog" aria-modal="true" aria-label="设置">
231232
<aside className="webui-settings-sidebar">
232-
<WebuiButton variant="quiet-secondary" size="header" type="button" aria-label="返回" className="webui-settings-back" onClick={onClose}>
233+
<WebuiButton variant="quiet-secondary" size="header" type="button" className="webui-settings-back" onClick={onClose}>
233234
<Icon name="back" />
234235
<span>返回应用</span>
235236
</WebuiButton>
@@ -520,7 +521,7 @@ function ArchivedSessionsPage({ sessions, canDelete, canUnarchive, onDelete, onU
520521
</SettingsSection>
521522
))
522523
) : (
523-
<p className="webui-archived-empty">{sessions.length ? "没有符合条件的聊天" : "暂无已归档聊天"}</p>
524+
<FeedbackEmpty className="webui-archived-empty" title={sessions.length ? "没有符合条件的聊天" : "暂无已归档聊天"} />
524525
)}
525526
</SettingsPage>
526527
);

0 commit comments

Comments
 (0)