Skip to content

TT-7232 UI changes#249

Open
sarahentzel wants to merge 3 commits intodevelopfrom
TT-7232
Open

TT-7232 UI changes#249
sarahentzel wants to merge 3 commits intodevelopfrom
TT-7232

Conversation

@sarahentzel
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 axiosPostInfilling helper 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.

Comment thread src/renderer/src/components/AudioDownload.tsx Outdated
Comment thread src/renderer/src/components/WSAudioPlayer.tsx Outdated
Comment thread src/renderer/src/components/AudioDownload.tsx Outdated
Comment thread src/renderer/src/utils/axios.tsx Outdated
Comment thread src/renderer/src/utils/axios.tsx Outdated
Comment thread src/renderer/src/utils/axios.tsx Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +69 to +75
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));
});
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +76 to +78
if (mediaState?.error?.startsWith('no offline file'))
showMessage(ts.fileNotFound);
else if (mediaState?.error) showMessage(mediaState.error);
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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);
}

Copilot uses AI. Check for mistakes.
Comment on lines +302 to +305
const audioDownload = useAudioDownload(mediaId ?? '');

const showWaveformSaveButton = showWaveformSave ?? true;
const [myMediaId, setMyMediaId] = useState(mediaId ?? '');
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
Comment thread migration/r4.4.1/copyprojectid2.sql Outdated
Comment thread tsconfig.tsbuildinfo Outdated
sarahentzel and others added 2 commits April 15, 2026 19:46
it was a duplicate

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants