Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to choose the transcript format #73

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

marjisound
Copy link
Contributor

@marjisound marjisound commented Mar 28, 2024

What does this change?

This PR adds options on the transcripts format when user is exporting the transcripts to a google document. The options are text and srt. It also adds validation so user can not submit the export unless they choose the format.

The api is also updated to use the transcriptFormat value from the query parameters in order to provide the relevant text format.

ezgif-6-e8096e3ad7

How to test

Tested locally and in CODE

@marjisound marjisound marked this pull request as ready for review April 1, 2024 14:46
@marjisound marjisound requested a review from a team April 1, 2024 14:46
@@ -69,9 +85,18 @@ const ExportButton = () => {
}

const exportHandler = async () => {
if (!transcriptFormat) {
console.log(`transcript format value is ${transcriptFormat}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

const transcriptFormatDescription: Record<TranscriptFormat, string> = {
srt: 'SRT format (Time Coded)',
text: 'TEXT format',
json: 'JSON format',
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the word 'format' from these since there is a label on the dropdown. I think TEXT should be title case 'Text' as I imagine many journalists won't be aware of TXT/ 'text' format - 'Text' seems clearer

Copy link
Contributor Author

@marjisound marjisound Apr 2, 2024

Choose a reason for hiding this comment

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

Good idea, how about srt? For now I changed it to Srt (with time code), but happy to change it again if you have other suggestion


const transcriptS3Key =
parsedItem.data.transcriptKeys[exportRequest.data.transcriptFormat];
console.log(`transcriptS3Key: ${transcriptS3Key}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

Copy link
Contributor

@philmcmahon philmcmahon left a comment

Choose a reason for hiding this comment

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

Looks great! Just one comment about not repeating the word 'format' but you might have already discussed that so feel free to ignore

{transcriptFormatDescription[TranscriptFormat.TEXT]}
</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make srt the default option in the dropdown? From journalist feedback it seems like this is the format they want most of the time.

Copy link
Contributor Author

@marjisound marjisound Apr 2, 2024

Choose a reason for hiding this comment

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

This is more of a UX point. I think by enforcing to choose one of the formats we are also letting user know that there are multiple formats to choose from, but if there's a format chosen by default, user might not even notice there are other formats. We can chat with @hoyla and see what he says too.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think Text might still be the most popular format - I suspect if we set SRT as the default initially then everyone would have emailed asking for a timecode-free version

Copy link
Contributor

Choose a reason for hiding this comment

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

good points! let's go with no default

@@ -26,6 +35,13 @@ const ExportButton = () => {
<InfoMessage message={'not logged in'} status={RequestStatus.Failed} />
);
}

const transcriptFormatDescription: Record<TranscriptFormat, string> = {
srt: 'SRT format (Time Coded)',
Copy link
Contributor

Choose a reason for hiding this comment

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

another formatting suggestion:
could we make this SRT (time-coded) or SRT (with time codes)

@marjisound marjisound merged commit 0a48c04 into main Apr 2, 2024
1 check passed
@marjisound marjisound deleted the add-option-to-choose-transcript-format branch April 2, 2024 10:54
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.

3 participants