Repository navigation
feat(transcripts): read and request transcripts via the EnrichmentObject APIs - #9
Conversation
…/poll flow The transcript APIs under content/v4/enrichment/object/* and the ?enrich=all read are replaced by the generic EnrichmentObject APIs, and phase 1 has no approve/reject/edit. Remove the old flow ahead of the new implementation. - ContentEditorService: drop createTranscript, updateTranscript, approveTranscript, rejectTranscript, readTranscripts and their endpoints - useEditor: drop the post-upload createTranscript call and the 20s transcript polling; hasTranscripts/transcripts/transcriptsChecked are inert until the enrichment-object read is added - TranscriptsDrawer: read-only, reads ed.transcripts; remove approve, reject, segment editing and status re-confirmation - i18n: remove 16 unused keys in all locales, reword NO_TRANSCRIPTS_SUB - editor.scss: remove styles for the removed UI - tests: remove suites for the removed behaviour, delete useEditor.test.ts
…ect APIs Replace the removed transcript flow with the generic EnrichmentObject model. Phase 1 is read-only: no approve, reject or edit. - Registry (services/enrichment) holds one entry per enrichmentObjectType (mimeTypes, upload prompt, labels, player mapping). Transcript is the first entry; everything else is type-agnostic. - Upload: the prompt shows one checkbox per applicable type. Only ticked types that also match the detected mimeType are saved, via a content update of enrichmentTypes using the versionKey from the fresh read. A failed save is non-fatal (toast + telemetry). - Read: listEnrichmentObjects calls POST /object/enrichment/v4/list once when a published content opens (pkgVersion set); no polling. Header buttons, the drawer and the preview captions read from that list. - UI: EnrichmentsDrawer shell with a read-only TranscriptPanel and shared status badge; preview captions use Live objects with a captionsUrl. - Types: EnrichmentObject, EnrichmentStatus, TranscriptObject; ContentData.enrichmentTypes; DrawerKind 'enrichments'. - i18n: ERROR_ENRICHMENT_SAVE in all locales; README capability row. - Upload telemetry/event payloads carry enrichmentTypes instead of generateTranscripts.
…g note - Keep the header button after a failed list load so the drawer's error and Retry are reachable; a failed reload no longer wipes loaded objects. - Clear saved enrichmentTypes when the creator unticks the box, or replaces the file with a URL source or a file the type does not apply to. - Derive enrichmentsChecked from the content key so the preview iframe is not mounted before the first list check settles. - Include captionsUrl in the preview iframe key so a replaced VTT reloads. - Check the response status and abort the segments fetch on unmount. - Keep the segments view open while a reload runs; show the spinner only when nothing is loaded yet. - Use allSettled when listing several types so one failure keeps the rest. - Label a missing status "Draft" to match its tone. - Remove the "translations will appear" note; the pipeline generates translations on its own. Drops the string in all six languages, its style and its tests.
pallakartheekreddy
left a comment
There was a problem hiding this comment.
Read the whole diff in three passes — the removal half, the new enrichment code, then the merge against both parents. Static read only; I didn't build or run anything.
The things most likely to go wrong here didn't. The removal is complete (no dangling references to any of the deleted methods, constants, types or SCSS, and ?enrich=all fed only the transcript list). The merge resolution is verifiably correct — the Dynamic Assess files are byte-identical to v1.1.2, and the only non-transcript change in the conflicted files is the readEnvelope extraction, which I diffed as pure extraction. All six locales carry exactly 218 keys with identical key sets, and no locale kept keys for the deleted approve/reject UI.
No blockers. The risk is where you flagged it — the clearing path and the failure path. Comments inline.
Small note: commit 3cf6e8e ("update package-lock.json") was fully reverted by the merge — git diff on package-lock.json is empty. Net dependency change is zero, which is right, but the commit message no longer describes anything.
Remove the hand-kept extensions list from the registry; the prompt now checks the file extension's mimeType against the type's mimeTypes, the same source the post-upload save uses.
Key the iframe on the transcripts passed to the player instead of every Live object, so a Live object without a caption URL no longer restarts playback.
parseSegments now returns an empty list for zero cues and null only for an unrecognised shape, so a silent video no longer reads as a load error.
The list is fetched once when the content opens, so a Processing status only changes on reload. Add a Refresh button that reuses reloadEnrichments and is disabled while a reload is in flight.
Add an optional headerAction slot to Drawer and render Refresh as an icon button beside Close, instead of a text row above the content.
Summary
Moves the editor's transcript support onto the generic EnrichmentObject model. The creator now only requests transcripts at upload time; the AI pipeline generates and auto-approves them after publish, and the editor reads them through the new list API. Review, edit, approve and reject are gone from the editor.
Related PRs (the same feature across the stack):
content-publishedevent on every publish)What changed
Removed (legacy flow)
TranscriptsDrawer(edit segments, approve, reject) and the matchingContentEditorServicemethods (createTranscript,updateTranscript,approveTranscript,rejectTranscript,readTranscripts).useEditor, the?enrich=allread, and the video-only constants (VIDEO_EXTENSIONS,isVideoMimeType).Added
services/enrichment/): one entry perenrichmentObjectTypeholding its mime types, upload-time checkbox, header and drawer labels, and how its objects apply to the player. Adding another type (for example Summary) is one registry entry plus a panel. Transcript is the first entry.listEnrichmentObjectsinContentEditorService:POST {portalSlug}/object/enrichment/v4/list, one call per type. A failing type no longer discards the others.enrichmentTypeson the content using the freshversionKey. Unticking, or replacing the content with a URL source or a file the type does not apply to, clears previously saved types.EnrichmentsDrawer. The transcript panel lists languages (source first) with status, "View segments" and "Download captions".pkgVersion), with Retry on failure. No polling.Also in this branch
v1.1.2(Dynamic Assess); conflicts inuseEditor,ContentEditorService,Header,EditorPreviewand the translation files are resolved, and the Dynamic Assess code is untouched.How it fits together
enrichmentTypes: ["Transcript"]on the content.content-publishedevent.Transcriptobject per language, and approves them toLive.Test plan
tscis clean and the full suite passes: 21 files, 280 tests (npm run buildnot run).enrichmentTypesis saved on the content.Notes
POST /object/enrichment/v4/listexposed through Kong under the portal slug.