ui: voice recorder pulse + TDS styling, wire mic denied error to input bar
- VoiceMessageRecorder recording dot now pulses (reuses pttLivePulse keyframe) - Added data-voice-recorder / data-voice-rec-dot / data-voice-waveform attributes for TDS targeting: green pulsing dot, cyan waveform bars, subtle border in TDS dark - Wire VoiceMessageRecorder onError to the same input-bar error display used by location errors (mic denied, media error surfaces to user instead of silent fail) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -185,6 +185,7 @@ export function VoiceMessageRecorder({ onSend, onError }: VoiceRecorderProps) {
|
|||||||
if (state === 'recording') {
|
if (state === 'recording') {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
|
data-voice-recorder="recording"
|
||||||
alignItems="Center"
|
alignItems="Center"
|
||||||
gap="200"
|
gap="200"
|
||||||
style={{
|
style={{
|
||||||
@@ -194,18 +195,21 @@ export function VoiceMessageRecorder({ onSend, onError }: VoiceRecorderProps) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
|
data-voice-rec-dot
|
||||||
style={{
|
style={{
|
||||||
width: toRem(8),
|
width: toRem(8),
|
||||||
height: toRem(8),
|
height: toRem(8),
|
||||||
borderRadius: '50%',
|
borderRadius: '50%',
|
||||||
background: 'var(--tc-danger-normal)',
|
background: 'var(--tc-danger-normal)',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
|
animation: 'pttLivePulse 900ms ease-in-out infinite',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Text size="T200" style={{ minWidth: toRem(32), fontVariantNumeric: 'tabular-nums' }}>
|
<Text size="T200" style={{ minWidth: toRem(32), fontVariantNumeric: 'tabular-nums' }}>
|
||||||
{formatDuration(durationMs)}
|
{formatDuration(durationMs)}
|
||||||
</Text>
|
</Text>
|
||||||
<Box
|
<Box
|
||||||
|
data-voice-waveform
|
||||||
alignItems="Center"
|
alignItems="Center"
|
||||||
gap="100"
|
gap="100"
|
||||||
style={{ height: toRem(20), overflow: 'hidden', flexShrink: 0 }}
|
style={{ height: toRem(20), overflow: 'hidden', flexShrink: 0 }}
|
||||||
|
|||||||
@@ -902,7 +902,13 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
|||||||
<Icon src={Icons.SpaceGlobe} size="100" />
|
<Icon src={Icons.SpaceGlobe} size="100" />
|
||||||
)}
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<VoiceMessageRecorder onSend={handleVoiceSend} />
|
<VoiceMessageRecorder
|
||||||
|
onSend={handleVoiceSend}
|
||||||
|
onError={(err) => {
|
||||||
|
setLocationError(err);
|
||||||
|
setTimeout(() => setLocationError(null), 4000);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={submit}
|
onClick={submit}
|
||||||
variant="SurfaceVariant"
|
variant="SurfaceVariant"
|
||||||
|
|||||||
@@ -921,6 +921,35 @@ globalStyle(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ── Voice recorder TDS ───────────────────────────────────────────────────────
|
||||||
|
globalStyle(`body.${lotusTerminalBodyClass} [data-voice-recorder="recording"]`, {
|
||||||
|
background: 'rgba(0,212,255,0.05) !important' as any,
|
||||||
|
border: '1px solid rgba(0,212,255,0.22) !important' as any,
|
||||||
|
borderRadius: '6px',
|
||||||
|
});
|
||||||
|
globalStyle(`body.${lotusTerminalBodyClass} [data-voice-rec-dot]`, {
|
||||||
|
background: '#00FF88 !important' as any,
|
||||||
|
boxShadow: '0 0 6px rgba(0,255,136,0.55)',
|
||||||
|
});
|
||||||
|
globalStyle(`body.${lotusTerminalBodyClass} [data-voice-waveform] > div`, {
|
||||||
|
background: '#00D4FF !important' as any,
|
||||||
|
});
|
||||||
|
// light TDS
|
||||||
|
globalStyle(
|
||||||
|
`html[data-theme="light"] body.${lotusTerminalBodyClass} [data-voice-recorder="recording"]`,
|
||||||
|
{
|
||||||
|
background: 'rgba(0,98,184,0.05) !important' as any,
|
||||||
|
border: '1px solid rgba(0,98,184,0.22) !important' as any,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
globalStyle(`html[data-theme="light"] body.${lotusTerminalBodyClass} [data-voice-rec-dot]`, {
|
||||||
|
background: '#006d35 !important' as any,
|
||||||
|
boxShadow: 'none',
|
||||||
|
});
|
||||||
|
globalStyle(`html[data-theme="light"] body.${lotusTerminalBodyClass} [data-voice-waveform] > div`, {
|
||||||
|
background: '#0062b8 !important' as any,
|
||||||
|
});
|
||||||
|
|
||||||
// ── Caption input TDS focus ring ──────────────────────────────────────────────
|
// ── Caption input TDS focus ring ──────────────────────────────────────────────
|
||||||
globalStyle(`body.${lotusTerminalBodyClass} [data-caption-input]:focus-visible`, {
|
globalStyle(`body.${lotusTerminalBodyClass} [data-caption-input]:focus-visible`, {
|
||||||
borderColor: 'rgba(255,107,0,0.65) !important' as any,
|
borderColor: 'rgba(255,107,0,0.65) !important' as any,
|
||||||
|
|||||||
Reference in New Issue
Block a user