Skip to content

feat: add in-platform transcript editor to the videos page - #3215

Open
abhalsod-sonata wants to merge 1 commit into
openedx:masterfrom
abhalsod-sonata:feat/in-platform-transcript-editor
Open

feat: add in-platform transcript editor to the videos page#3215
abhalsod-sonata wants to merge 1 commit into
openedx:masterfrom
abhalsod-sonata:feat/in-platform-transcript-editor

Conversation

@abhalsod-sonata

@abhalsod-sonata abhalsod-sonata commented Aug 27, 2026

Copy link
Copy Markdown

Adds an in-platform transcript editor to the Studio videos page. Course authors can
open "Edit transcript" from a transcript row's action menu and edit the SRT in the
browser instead of the download → edit locally → re-upload round-trip.

What's included:

  • New transcript-editor/ module: cue-by-cue text editing with SRT parsing/validation
    (srtUtils), invalid-SRT alerting, debounced auto-save, and a video preview with
    click-to-seek + active-cue highlighting and auto-scroll.
  • The video Info content moves under the preview (InfoTab via a new
    infoModalContentUnderPreview slot on FileTable/InfoModal), and the info sidebar
    lists transcripts directly - this intentionally supersedes the previous tabbed
    sidebar layout for videos.
  • The row action menu label for videos changes from "Info" to "Info and
    transcripts"
    (FileMenu, MoreInfoColumn); two existing tests that asserted the
    old label on video fixtures are updated.
  • Saving a transcript re-uploads the SRT through the existing /transcript_upload/
    endpoint; the UI distinguishes replace (200) from create (201) - see dependency
    below.

Impacted user roles: Course Authors (primary); Developers (new
transcript-editor module and the infoModalContentUnderPreview extension point on
the generic file table).

Screen recording:

  • Before:
Before.mp4
  • After
After.mp4

Supporting information

Testing instructions

Automated:

npm ci
npx jest src/files-and-videos --coverage=false
# 20 suites / 229 tests expected green

Manual (tutor dev):

  1. Check out feat: return 200 when a transcript upload replaces an existing language openedx-platform#39038 in your platform (or any branch
    containing it) and run Studio.
  2. npm run dev in this repo (port 2001); open a course with videos that have
    transcripts → Videos page.
  3. Row ⋮ menu shows "Info and transcripts" (videos only; Files page unchanged);
    the info modal shows the video preview with Info content below it and
    transcripts listed in the sidebar.
  4. Transcript row menu → Edit transcript: edit a cue, watch auto-save, Save;
    reopen to confirm persistence; click cues to seek the preview.
  5. Paste invalid SRT content → validation alert, save blocked.
  6. Network tab: re-saving an existing language returns 200; adding a new language
    returns 201.

Other information

  • Port provenance & adaptations (for reviewers comparing against the downstream
    PRs): rebased onto current master, which required - merging with the new
    permissions gating in FileTable/MoreInfoColumn; porting one-line changes into
    the TS-renamed FileMenu.tsx and messages.ts files; re-applying the
    injectIntl → useIntl migration on top of the reworked Transcript.jsx; and
    keeping upstream's key={idx} fix in TranscriptTab.
  • CourseVideosTable still passes activeTab/setActiveTab into the sidebar factory
    for compatibility; the new sidebar ignores them. Happy to remove that plumbing here
    or in a follow-up if preferred.
  • Playback: seekTo() guards the play() promise and ignores AbortError
    (interrupted play on rapid cue-seek/pause/unmount), logging anything else.
  • Accessibility: built from Paragon components (Menu, AlertModal, form controls);
    no dedicated audit yet - feedback welcome, especially on cue-list keyboard
    navigation.
  • i18n: all new messages include translator descriptions; existing message ids are
    unchanged so downstream translations carry over.

Best Practices Checklist

  • Any new files are using TypeScript (.ts, .tsx).
    - The new transcript-editor/ module is ported as .jsx/.js to stay
    reviewably close to the downstream original. Happy to convert
    TranscriptEditor/srtUtils to TS in this PR if preferred
    - say the word.
  • Avoid propTypes and defaultProps in any new or modified code.
    - Ported/modified components follow the surrounding files' existing
    PropTypes style; will drop them as part of the TS conversion above if requested.
  • Tests should use the helpers in src/testUtils.tsx (initializeMocks)
    - Changes extend the existing videos-page suites, which predate
    initializeMocks; kept their established setup for consistency.
  • Do not add new fields to the Redux state/store. (No slice/thunk changes;
    editor state is component-local.)
  • Use React Query to load data from REST APIs.
    - Transcript content is fetched via the page's existing axios helpers
    (videos-page/data/api.js); this page has not been migrated to React Query yet.
  • All new i18n messages in messages files have a description for translators.
  • Avoid ../ in import paths; use @src for parent-folder imports.

Relevant backend PR

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 27, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @abhalsod-sonata!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Submit a signed contributor agreement (CLA)

⚠️ We ask all contributors to the Open edX project to submit a signed contributor agreement or indicate their institutional affiliation.
Please see the CONTRIBUTING file for more information.

If you've signed an agreement in the past, you may need to re-sign.
See The New Home of the Open edX Codebase for details.

Once you've signed the CLA, please allow 1 business day for it to be processed.
After this time, you can re-run the CLA check by adding a comment below that you have signed it.
If the CLA check continues to fail, you can tag the @openedx/cla-problems team in a comment for further assistance.

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Aug 27, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Needs Tests Run or CLA Signed in Contributions Aug 27, 2026
@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 27, 2026
@mphilbrick211

Copy link
Copy Markdown

Hi @abhalsod-sonata! in order to get your CLA check to turn green, please have your manager reach out to oscm@axim.org to have you added to our existing entity agreement.

Thank you!

@mphilbrick211 mphilbrick211 removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Aug 27, 2026
@abhalsod-sonata
abhalsod-sonata force-pushed the feat/in-platform-transcript-editor branch from eb30fd5 to 4b28c54 Compare August 28, 2026 07:28
@abhalsod-sonata

Copy link
Copy Markdown
Author

Hi @abhalsod-sonata! in order to get your CLA check to turn green, please have your manager reach out to oscm@axim.org to have you added to our existing entity agreement.

Thank you!

CLA check resolved!

@abhalsod-sonata

Copy link
Copy Markdown
Author

@bradenmacdonald
Can you please review and approve this PR?

@mphilbrick211 mphilbrick211 added needs test run Author's first PR to this repository, awaiting test authorization from Axim and removed needs test run Author's first PR to this repository, awaiting test authorization from Axim labels Aug 28, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Tests Run or CLA Signed to Ready for Review in Contributions Aug 28, 2026
@bradenmacdonald

Copy link
Copy Markdown
Contributor

@abhalsod-sonata Thanks, this is cool!

I'd definitely prefer to have the new files converted to TypeScript and ideally to src/testUtils.tsx too.

Since you've expressed that it's helpful to keep the code in sync with your existing code, could you not apply the same changes to the existing codebase as well, so they stay in sync?

Course authors can now edit video transcripts directly in Studio:
"Edit transcript" in a transcript row's action menu opens an editor
with per-cue text editing, SRT validation, debounced auto-save, and
click-to-seek playback with active-cue highlighting against the video
preview. The video's Info content moves below the preview (InfoTab),
the sidebar lists transcripts directly, and the row menu label becomes
"Info and transcripts" for videos.
@abhalsod-sonata
abhalsod-sonata force-pushed the feat/in-platform-transcript-editor branch from 4b28c54 to 1aa5b83 Compare August 31, 2026 08:54
@abhalsod-sonata

Copy link
Copy Markdown
Author

@abhalsod-sonata Thanks, this is cool!

I'd definitely prefer to have the new files converted to TypeScript and ideally to src/testUtils.tsx too.

Since you've expressed that it's helpful to keep the code in sync with your existing code, could you not apply the same changes to the existing codebase as well, so they stay in sync?

@bradenmacdonald
Thanks! done - the transcript-editor module is now TypeScript, with PropTypes/defaultProps removed, and the new TranscriptEditor.test.tsx use initializeMocks from src/testUtils.tsx.

@abhalsod-sonata

Copy link
Copy Markdown
Author

@mphilbrick211, I’m unable to add @bradenmacdonald as a reviewer. Could you please add them to this PR?

@mphilbrick211

Copy link
Copy Markdown

@mphilbrick211, I’m unable to add @bradenmacdonald as a reviewer. Could you please add them to this PR?

All set! @bradenmacdonald could you re-enable the checks to run?

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.47122% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.84%. Comparing base (16e19f1) to head (1aa5b83).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...videos-page/transcript-editor/TranscriptEditor.tsx 94.48% 14 Missing ⚠️
...-videos/videos-page/info-sidebar/TranscriptTab.jsx 90.09% 10 Missing ⚠️
...s-page/info-sidebar/transcript-item/Transcript.jsx 71.42% 5 Missing and 1 partial ⚠️
...ge/info-sidebar/transcript-item/TranscriptMenu.jsx 50.00% 4 Missing ⚠️
...mponents/table-custom-columns/TranscriptColumn.jsx 62.50% 3 Missing ⚠️
...files-and-videos/videos-page/CourseVideosTable.tsx 75.00% 1 Missing ⚠️
...ge/info-sidebar/transcript-item/LanguageSelect.jsx 92.30% 1 Missing ⚠️
...d-videos/videos-page/transcript-editor/srtUtils.ts 97.82% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3215      +/-   ##
==========================================
- Coverage   95.92%   95.84%   -0.08%     
==========================================
  Files        1397     1401       +4     
  Lines       33581    34022     +441     
  Branches     7947     8045      +98     
==========================================
+ Hits        32214    32610     +396     
- Misses       1308     1352      +44     
- Partials       59       60       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! This is really cool. I did find a bunch of issues that we should clean up before merging, but feel free to push back on anything that doesn't make sense or is out of scope.

  1. It seems odd that you can edit an existing transcript but not create one from scratch. Should it be possible to create a blank transcript and then fill it out?
  2. When the transcript fails to download, it says "Unable to save transcript" which is a confusing error message. It should have a clear, distinct error message for this case.
    Image
  3. Nit/optional: The formatting of the timestamps uses a comma , as the decimal point marker, which is incorrect for English-speaking countries and looks strange to me. I think it should use . or be based on the user's locale.
    Image
  4. The description says "Depends on feat: return 200 when a transcript upload replaces an existing language openedx-platform#39038", but I can't see in the diff where that would make a difference or where that return code is used.
  5. There are a lot more minor issues that Claude pointed out to me, which I haven't bothered to re-state here for now. I suggest you get Claude or another AI to review the PR and work through any important issues it reports and then ping me for a final review.

launchDeleteConfirmation,
handleTranscript,
input,
onEdit,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Set defaults here, not using defaultProps:

Suggested change
onEdit,
onEdit = () => {},


TranscriptActionMenu.defaultProps = {
onEdit: () => {},
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is causing a console warning:
Image

Please don't add any new usages of defaultProps.

import { TRANSCRIPT_FAILURE_STATUSES } from '../../../videos-page/data/constants';

const TranscriptColumn = ({ row }) => {
const TranscriptColumn = ({ row, handleOpenFileInfo }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const TranscriptColumn = ({ row, handleOpenFileInfo }) => {
const TranscriptColumn = ({ row, handleOpenFileInfo = null }) => {

Comment on lines +53 to 55
TranscriptColumn.defaultProps = {
handleOpenFileInfo: null,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
TranscriptColumn.defaultProps = {
handleOpenFileInfo: null,
};

Please use JS default prop values instead of defaultProps, as defaultProps causes console warnings and will stop working in React 19.

handleOpenFileInfo(row.original);
}}
>
{transcriptMessage}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is mostly an existing problem, but:

  • In this case, {transcriptMessage} is not translated and will just say (N) available regardless of the user's language.
  • Why is it a link when transcripts > 1 but not a link when transcripts = 0. Shouldn't I be able to click on "0 transcripts" to open the dialog and add a transcript?
  • The syntax "(3) available" makes no sense. What are the parentheses ( ) even doing? It's not correct punctuation. Just "3 available" is better. "(3 available)" would also be acceptable.

There should be a message in messages.ts like this:

  transcriptCountLabel: {
    id: 'course-authoring.videos-page.table.transcriptColumn.message',
    defaultMessage: '{numOfTranscripts, plural, one {{numOfTranscripts} transcript} other {{numOfTranscripts} transcripts}}',
    description: 'Message with the number of transcripts available',
  },

and you should pass in values={{ numOfTranscripts, }}.

Comment on lines +523 to +525
<Form.Control
type="text"
value={cue.text}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rendering the cue text in <Form.Control type="text"> creates a single-line control, and the browser will strip out any newlines:

Image

But SRT files often have multi-line strings, and there are test cases and other parts of the code here clearly designed to handle that. Try using a textarea with autosizing instead? And make sure there is a test that verifies \n is preserved when entering/editing multi-line cues in the actual UI.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, please add accessible names to these fields (aria-label or similar). Same with the timestamp fields. They currently have no accessible name at all, so screen reader users may not know what field is what.

Image

Header: 'Transcript',
accessor: 'transcriptStatus',
Cell: ({ row }) => TranscriptColumn({ row }),
Cell: ({ row, handleOpenFileInfo }: any) => TranscriptColumn({ row, handleOpenFileInfo }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is handleOpenFileInfo ever actually passed here? Claude says it's not, and the any is showing us that fact. Perhaps use infoModalContentUnderPreview instead.

Comment on lines 78 to 79
const { data } = await getAuthenticatedHttpClient()
.get(`${getApiBaseUrl()}${apiUrl}?edx_video_id=${videoId}&language_code=${language}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is exactly the same as fetchTranscriptContent below, so it should call fetchTranscriptContent() instead of duplicating the code.

Comment on lines +78 to +79
key={`transcript-${language}`}
data-testid={`transcript-${language}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: I don't think we need key outside of a loop, and it's best to avoid data-testid if possible.

<MenuItem
as={Button}
variant="tertiary"
key={`transcript-actions-${language}-edit`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this key is doing anything? Same below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

4 participants