mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Merge dev to main - UI improvements & code cleanup (#104)
* Fix TypeScript error in git-errors.ts * Remove code review documentation * Improve stt response time * Fix repo navigation when download dialog closes
This commit is contained in:
1 parent
059b9a172c
commit
81e1fba687
3 files changed
+28
-1
No files matched your search
@@ -55,7 +55,7 @@ export function RepoCard({
|
||||
const unstagedCount = gitStatus?.files.filter((f) => !f.staged).length || 0;
|
||||
|
||||
const handleCardClick = () => {
|
||||
if (isReady && !showSourceControl) {
|
||||
if (isReady && !showSourceControl && !showDownloadDialog) {
|
||||
navigate(`/repos/${repo.id}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -166,6 +166,8 @@ export function useSTT(userId = 'default') {
|
||||
audioRecorder.current = new AudioRecorder()
|
||||
}
|
||||
|
||||
audioRecorder.current.warmup()
|
||||
|
||||
setupAudioRecorder(audioRecorder.current)
|
||||
|
||||
return () => {
|
||||
|
||||
@@ -53,6 +53,26 @@ export class AudioRecorder {
|
||||
)
|
||||
}
|
||||
|
||||
async warmup(): Promise<boolean> {
|
||||
if (!AudioRecorder.isSupported()) {
|
||||
return false
|
||||
}
|
||||
|
||||
try {
|
||||
const stream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: {
|
||||
echoCancellation: true,
|
||||
noiseSuppression: true,
|
||||
autoGainControl: true,
|
||||
},
|
||||
})
|
||||
stream.getTracks().forEach(track => track.stop())
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
getState(): AudioRecorderState {
|
||||
return this.state
|
||||
}
|
||||
@@ -186,3 +206,8 @@ export function getAudioRecorder(): AudioRecorder {
|
||||
export function isAudioRecordingSupported(): boolean {
|
||||
return AudioRecorder.isSupported()
|
||||
}
|
||||
|
||||
export async function warmupAudioRecorder(): Promise<boolean> {
|
||||
const recorder = getAudioRecorder()
|
||||
return recorder.warmup()
|
||||
}
|
||||
Reference in new issue
Block a user