-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
@@ -69,9 +85,18 @@ const ExportButton = () => { | |||
} | |||
|
|||
const exportHandler = async () => { | |||
if (!transcriptFormat) { | |||
console.log(`transcript format value is ${transcriptFormat}`); |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
packages/api/src/index.ts
Outdated
|
||
const transcriptS3Key = | ||
parsedItem.data.transcriptKeys[exportRequest.data.transcriptFormat]; | ||
console.log(`transcriptS3Key: ${transcriptS3Key}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)', |
There was a problem hiding this comment.
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)
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.How to test
Tested locally and in CODE