Fix the small mechanical rules. [skip build]
Checks / checks (push) Successful in 2m12s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-01 10:28:59 +11:00
parent bb85cd9778
commit 73554ecf7f
45 changed files with 331 additions and 347 deletions
+40 -32
View File
@@ -771,6 +771,42 @@ export function Audio({ requestClose }: AudioProps) {
settings.autoGainControl,
]);
let micVariant: 'Critical' | 'Success' | 'Secondary';
if (micTestState === 'error') {
micVariant = 'Critical';
} else if (micTestState === 'done') {
micVariant = 'Success';
} else {
micVariant = 'Secondary';
}
let micLabel = 'Test';
if (micTestState === 'testing') {
micLabel = 'Testing...';
} else if (micTestState === 'done') {
micLabel = 'Done ✓';
} else if (micTestState === 'error') {
micLabel = 'Failed';
}
let speakerVariant: 'Critical' | 'Success' | 'Secondary';
if (speakerTestState === 'error') {
speakerVariant = 'Critical';
} else if (speakerTestState === 'done') {
speakerVariant = 'Success';
} else {
speakerVariant = 'Secondary';
}
let speakerLabel = 'Test';
if (speakerTestState === 'testing') {
speakerLabel = 'Playing...';
} else if (speakerTestState === 'done') {
speakerLabel = 'Done ✓';
} else if (speakerTestState === 'error') {
speakerLabel = 'Failed';
}
return (
<Page>
<PageHeader>
@@ -833,27 +869,13 @@ export function Audio({ requestClose }: AudioProps) {
<Box gap="200" alignItems="Center">
<Button
size="300"
variant={
micTestState === 'error'
? 'Critical'
: micTestState === 'done'
? 'Success'
: 'Secondary'
}
variant={micVariant}
fill="Soft"
radii="300"
onClick={handleTestMicrophone}
disabled={micTestState === 'testing' || micMonitoring}
>
<Text size="T300">
{micTestState === 'testing'
? 'Testing...'
: micTestState === 'done'
? 'Done ✓'
: micTestState === 'error'
? 'Failed'
: 'Test'}
</Text>
<Text size="T300">{micLabel}</Text>
</Button>
<Button
size="300"
@@ -915,27 +937,13 @@ export function Audio({ requestClose }: AudioProps) {
/>
<Button
size="300"
variant={
speakerTestState === 'error'
? 'Critical'
: speakerTestState === 'done'
? 'Success'
: 'Secondary'
}
variant={speakerVariant}
fill="Soft"
radii="300"
onClick={handleTestSpeaker}
disabled={speakerTestState === 'testing'}
>
<Text size="T300">
{speakerTestState === 'testing'
? 'Playing...'
: speakerTestState === 'done'
? 'Done ✓'
: speakerTestState === 'error'
? 'Failed'
: 'Test'}
</Text>
<Text size="T300">{speakerLabel}</Text>
</Button>
</Box>
}