Conversation
There was a problem hiding this comment.
Pull request overview
Updates recorder UI copy and controls (reset → clear, dialog rename), adds an audio download entry to the WSAudioPlayer “More” menu, and introduces an axios helper for an “infilling” API call in the renderer.
Changes:
- Update localization strings from “Discard/Reset” to “Clear” across UI and localization artifacts.
- Adjust WSAudioPlayer UI: move zoom controls into the main toolbar areas and add audio download into the “More” menu; rename DeleteDialog → ClearDialog.
- Add
axiosPostInfillinghelper to post base64 audio plus replacement metadata.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/utils/axios.tsx | Adds sanitizeBase64 and new axiosPostInfilling helper for infilling POST payloads. |
| src/renderer/src/store/localization/reducers.tsx | Updates English UI strings (“Discard/Reset” → “Clear”). |
| src/renderer/src/store/localization/exported-strings-name.json | Updates generated localization bundle filename reference. |
| src/renderer/src/components/WSAudioPlayer.tsx | UI/UX tweaks: zoom placement changes, Clear dialog wiring, and audio download moved into the More menu. |
| src/renderer/src/components/PassageDetail/mobile/record/ClearDialog.tsx | Renames DeleteDialog to ClearDialog (component + default export). |
| src/renderer/src/components/PassageDetail/mobile/record/ClearDialog.cy.tsx | Updates Cypress component test to match ClearDialog and new copy. |
| src/renderer/src/components/AudioDownload.tsx | Adds imperative ref API and menuItem rendering variant. |
| localization/TranscriberAdmin-en.xlf | Updates source strings to “Clear …”. |
| localization/TranscriberAdmin-en-1.2.xliff | Updates source strings to “Clear …” (generation source). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 16 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| useEffect(() => { | ||
| setBlobUrl(''); | ||
| if (mediaState.status === MediaSt.FETCHED) | ||
| loadBlob(mediaState.url, (url, b) => { | ||
| //not sure what this intermediary file is, but causes console errors | ||
| if (b && b?.type !== 'text/html') setBlobUrl(URL.createObjectURL(b)); | ||
| }); |
There was a problem hiding this comment.
URL.createObjectURL(b) is created for the downloaded blob, but the object URL is never revoked. Over time this can leak memory in long-running sessions. Revoke the previous URL when replacing it, and add a cleanup effect to revoke on unmount.
| if (mediaState?.error?.startsWith('no offline file')) | ||
| showMessage(ts.fileNotFound); | ||
| else if (mediaState?.error) showMessage(mediaState.error); |
There was a problem hiding this comment.
When mediaState.error is set (e.g. offline file missing or fetch failure), audName is never cleared. Since isDisabled depends on audName !== '', a failed download attempt can leave the download action permanently disabled until the component remounts. Consider resetting audName (and any pending fetch state) when an error occurs.
| if (mediaState?.error?.startsWith('no offline file')) | |
| showMessage(ts.fileNotFound); | |
| else if (mediaState?.error) showMessage(mediaState.error); | |
| if (mediaState?.error) { | |
| setAudName(''); | |
| setBlobUrl(''); | |
| fetchMediaUrl({ id: '' }); | |
| if (mediaState.error.startsWith('no offline file')) | |
| showMessage(ts.fileNotFound); | |
| else showMessage(mediaState.error); | |
| } |
| const audioDownload = useAudioDownload(mediaId ?? ''); | ||
|
|
||
| const showWaveformSaveButton = showWaveformSave ?? true; | ||
| const [myMediaId, setMyMediaId] = useState(mediaId ?? ''); |
There was a problem hiding this comment.
myMediaId is initialized from mediaId but never updated when the mediaId prop changes, and useAudioDownload is still wired to the original mediaId prop. After calling setMyMediaId('') (e.g. on edit/clear), the download menu can stay hidden even when a new mediaId is later provided. Keep myMediaId in sync with mediaId (e.g. via an effect) and pass the same ID consistently to useAudioDownload/AudioDownloadView.
| const audioDownload = useAudioDownload(mediaId ?? ''); | |
| const showWaveformSaveButton = showWaveformSave ?? true; | |
| const [myMediaId, setMyMediaId] = useState(mediaId ?? ''); | |
| const showWaveformSaveButton = showWaveformSave ?? true; | |
| const [myMediaId, setMyMediaId] = useState(mediaId ?? ''); | |
| useEffect(() => { | |
| setMyMediaId(mediaId ?? ''); | |
| }, [mediaId]); | |
| const audioDownload = useAudioDownload(myMediaId); |
it was a duplicate Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.