Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | 'use client' import { useAudioManagerInstance } from '@/contexts/AudioManagerContext' import { useAudioManager } from '@/hooks/useAudioManager' import { AppNavBar } from '@/components/AppNavBar' import { AdminNav } from '@/components/AdminNav' import { css } from '../../../../styled-system/css' import { RouterChangeTest } from './tests/RouterChangeTest' import { RapidFireTest } from './tests/RapidFireTest' import { StrictModeTest } from './tests/StrictModeTest' import { MultiClipSequenceTest } from './tests/MultiClipSequenceTest' import { NovelClipTest } from './tests/NovelClipTest' import { MixedSourceTest } from './tests/MixedSourceTest' function ManagerStateBar() { const manager = useAudioManagerInstance() const { isEnabled, isPlaying, volume, setEnabled } = useAudioManager() const collection = manager.getCollection() const voiceChainAvail = manager.getClipAvailability('number-1') // probe to see chain return ( <div data-component="ManagerStateBar" className={css({ backgroundColor: '#161b22', border: '1px solid #30363d', borderRadius: '8px', padding: '12px 16px', display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: '16px', fontSize: '12px', })} > <div className={css({ display: 'flex', alignItems: 'center', gap: '8px' })}> <span className={css({ color: '#8b949e' })}>Enabled:</span> <span style={{ color: isEnabled ? '#3fb950' : '#f85149' }}>{isEnabled ? 'YES' : 'NO'}</span> <button onClick={() => setEnabled(true)} className={css({ fontSize: '11px', padding: '2px 8px', borderRadius: '4px', border: '1px solid #3fb950', backgroundColor: 'transparent', color: '#3fb950', cursor: 'pointer', _hover: { backgroundColor: '#3fb95020' }, })} > Force Enable </button> </div> <div className={css({ display: 'flex', alignItems: 'center', gap: '8px' })}> <span className={css({ color: '#8b949e' })}>Playing:</span> <span style={{ color: isPlaying ? '#58a6ff' : '#484f58' }}>{isPlaying ? 'YES' : 'NO'}</span> </div> <div className={css({ display: 'flex', alignItems: 'center', gap: '8px' })}> <span className={css({ color: '#8b949e' })}>Volume:</span> <span className={css({ color: '#c9d1d9' })}>{Math.round(volume * 100)}%</span> </div> <div className={css({ display: 'flex', alignItems: 'center', gap: '8px' })}> <span className={css({ color: '#8b949e' })}>Collection:</span> <span className={css({ color: '#c9d1d9' })}>{collection.length} clips</span> </div> <div className={css({ display: 'flex', alignItems: 'center', gap: '8px' })}> <span className={css({ color: '#8b949e' })}>Voice chain:</span> <span className={css({ color: '#c9d1d9' })}> {voiceChainAvail.length === 0 ? '(none)' : voiceChainAvail .map((a) => (a.source.type === 'pregenerated' ? a.source.name : 'browser-tts')) .join(' → ')} </span> </div> </div> ) } export function TtsLabPage() { return ( <> <AppNavBar navSlot={null} /> <div className={css({ paddingTop: '56px' })}> <AdminNav /> </div> <div data-component="TtsLabPage" className={css({ backgroundColor: '#0d1117', minHeight: '100vh', color: '#c9d1d9', padding: '24px', })} > <div className={css({ maxWidth: '900px', margin: '0 auto' })}> <h1 className={css({ fontSize: '20px', fontWeight: '600', color: '#f0f6fc', marginBottom: '4px', })} > TTS Diagnostic Lab </h1> <p className={css({ fontSize: '13px', color: '#8b949e', marginBottom: '16px' })}> Reliability testing for useTTS and TtsAudioManager under stress conditions </p> <ManagerStateBar /> <div className={css({ display: 'flex', flexDirection: 'column', gap: '16px', marginTop: '16px', })} > <RouterChangeTest /> <RapidFireTest /> <StrictModeTest /> <MultiClipSequenceTest /> <NovelClipTest /> <MixedSourceTest /> </div> </div> </div> </> ) } |