Repository navigation
feat(transcripts): read transcripts via the EnrichmentObject list API and add a Transcripts workspace filter - #505
Conversation
…filter Transcripts move to the generic EnrichmentObject list API and the workspace filter moves to the Content.enrichmentTypes search field, so remove the old read path and filter ahead of the new implementation. - ContentService: drop mapRawTranscripts, the enrichTranscripts parameter and enrich=all from contentRead, and the exists forwarding from contentSearch - useContentRead: drop the enrichTranscripts option and its query key entry - ContentPlayerPage, CollectionDetailPage, ContentViewPage: stop requesting enriched reads - types: drop RawTranscript, ContentEnrichment and ContentData.enrichment; drop exists from ContentSearchRequest - useWorkspace: drop both exists: ['enrichment'] spreads; the transcriptFilter toggle is inert until the enrichmentTypes filter lands - tests: remove suites and assertions for the removed behaviour
… and filter by enrichmentTypes
Transcripts now come from the generic EnrichmentObject model instead of
the removed enrich=all read, and the workspace filter uses the
Content.enrichmentTypes search field instead of the removed exists filter.
- Registry (services/enrichment) holds one entry per enrichmentObjectType:
applicable mimeTypes, workspace filter label, and the player mapping.
Transcript is the first entry; only Live objects with a captionsUrl map
to player transcripts.
- EnrichmentObjectService calls POST /object/enrichment/v4/list
(request.enrichmentObject.{parentId, enrichmentObjectType}).
- useContentWithEnrichments reads the content, lists its enrichment
objects for video mimeTypes, and returns one memoized object so the
player is not rebuilt; a failing list call yields plain content. Used
by ContentPlayerPage, CollectionDetailPage and ContentViewPage.
- Workspace filter is generic: one toggle per registry entry, state
enrichmentFilter, URL param ?enrichment=, and filters.enrichmentTypes
in both the counts and content queries. The old ?transcripts=1 URL is
no longer honored.
- Locales: workspace.hasTranscripts replaced by
workspace.enrichmentFilters.Transcript ("Transcript requested").
- ContentData.enrichmentTypes added; enrichmentTypes added to the default
content read fields.
…ve stale cards A Live content and its editing copy (Processing/Review) come back from search under the same identifier. Keyed by id alone, React could not tell the two apart: toggling a filter off and on updated the grid in place and left cards from the previous list in the DOM while the item count was correct. Key the grid card and the list row by `id-status` so each gets its own identity, and cover it with a rerender test.
…on cards Replace the per-type "Transcript requested" text filter with one icon-only sparkle toggle that selects every registered enrichment type (ENRICHMENT_TYPES) through `enrichmentTypes` in the search filters, keeping the ?enrichment= URL param. Adding another enrichment type later needs only a registry entry. With the toggle on, show a badge per enrichment type on each card and list row when the content actually has Live objects of that type. Availability comes from one EnrichmentObject search for the ids on screen (useEnrichmentAvailability), not one call per card; a failed search just leaves the cards without badges. The registry entry now carries the badge icon and tooltip key, and the mapper keeps the requested `enrichmentTypes` so only those contents are looked up. The fr, pt and ar strings (tooltips) need a native review.
…ts filter Restore the per-type enrichment filter button in the workspace and drop the sparkle toggle, the enrichment badges on cards and list rows, and the availability lookup behind them (useEnrichmentAvailability, availability.ts, EnrichmentIcons, the mapper and type additions that only served the badges). The filter button label is now "Transcripts" (was "Transcript requested"). The fr, pt and ar strings need a native review.
…s filter is on Bring back the closed-caption badge on workspace cards and list rows, on top of the per-type "Transcripts" filter button (the sparkle toggle stays removed). With the filter on, a badge per enrichment type appears only when the content has a Live object of that type. Availability comes from one EnrichmentObject search for the ids on screen (useEnrichmentAvailability), not one call per card; a failed search just leaves the cards without badges. The registry entry carries the badge icon and label key, and the filter button now reads the same label key, so the unused workspace.enrichmentFilters strings are dropped. The fr, pt and ar strings need a native review.
pallakartheekreddy
left a comment
There was a problem hiding this comment.
Static read of the whole diff (didn't build or run anything).
The hard parts hold up: the removal is clean with no dangling references, the merge preserves all of v1.1.2 (and doesn't touch dynamicAssessSubset.ts), the loading gate genuinely gates — I traced react-query's observer behaviour and there's no render window where the player sees unmerged content — and the tests assert real behaviour, including the request bodies.
But the unknown you flagged turns out to be the bad case. A logged-out learner opening any MP4 gets force-logged-out. One line fixes it. Details inline.
One note that isn't on a changed line: ContentService.ts:6 still asks the read for 'transcripts', but nothing maps it anymore — so a legacy raw transcripts array would reach the player in the un-normalised shape mapRawTranscripts used to fix. Either drop the field or strip it in applyToContent.
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository because its GitHub organization is not linked to your Claude organization.
To turn it back on, one person needs both roles: owner of the GitHub organization (or the account owner, for a personal repository) and admin or owner of your Claude organization. If that is not you, pass this on to someone who is.
Open Organization settings, Git providers and click Link next to the GitHub organization's name. If it is not listed, click Enable GitHub integration or Connect your GitHub first, whichever the page shows.
New pull requests are then reviewed as before. To get a review on one that is already open, someone with write access can comment @claude review.
Tip: disable this comment in your organization's Code Review settings.
Logged-out learners open the public video player, which lists a content's enrichment objects for captions. The route was not in the anonymous proxy allowlist, so it hit the authenticated catch-all and returned 401. Only list is exposed; create, approve and reject stay behind login.
The player waits for the list before mounting, so a call that never answered kept the page on the loader. list() now rejects after 5s and the player renders without captions.
A refetch that finds a newly Live transcript changes the merged content and rebuilds the player mid-playback.
The badge search covered every id loaded so far, so each infinite-scroll page re-searched all earlier ids and kept every result set cached. Ids are now searched in chunks of 20 with stable query keys, so a new page only searches the new ids.
Captions now come from Live EnrichmentObjects. Requesting the free-form transcripts field on Content could hand the player an unconverted legacy value when no Live object exists.
…toggle Reword the badge and registry comments to match what they describe, and replace a nested ternary in the filter handler with plain statements.
The lockfile written by npm 11 dropped the optional @emnapi/core and @emnapi/runtime entries and added peer annotations. npm ci in the Docker build rejects that file as out of sync. Restore the previous lockfile and apply only the generic-editor-v2 2.0.8 change.
|



Summary
Moves the portal's transcript support from the old
content/v4/read?enrich=allflow to the generic EnrichmentObject model, and adds a "Transcripts" filter with closed-caption badges to the workspace.Related PRs (the same feature across the stack):
content-publishedevent on every publish)What changed
Removed
enrich=allon content reads and theexists: ['enrichment']search filter, which the backend no longer supports.Reading transcripts
EnrichmentObjectServicecallsPOST /object/enrichment/v4/listwith{request:{enrichmentObject:{parentId, enrichmentObjectType?}}}, one call per type.useContentWithEnrichmentshook reads the content, lists its enrichment objects, and merges the Live ones into the content the player receives. It stays loading until both settle, so the player is not rebuilt mid-playback. A failing list returns the plain content and never an error page. Used by the content player, collection detail and content view (edit mode) pages.services/enrichment/) holds one entry perenrichmentObjectType(type, mime types, badge icon, label key, how its objects apply to the content). Adding a type such as Summary is one registry entry. Transcript is the first.Workspace
Content.enrichmentTypes(what the creator requested). The state lives in the?enrichment=URL param and applies to both the content list and the tab counts.EnrichmentObjectsearch covers the ids on screen (useEnrichmentAvailability), not one call per card. If that search fails, cards just show no badge.idandstatus. A Live content and its editing copy share one identifier in search results, so keying onidalone left stale cards in the DOM when the filter was toggled. A re-render test covers it.Strings
workspace.enrichmentFilters-style labels are nowworkspace.enrichmentLabels.Transcript("Transcripts") in en, fr, pt and ar.Merged
v1.1.2(Dynamic Assess); the conflicts inContentService,ContentViewPage.testand the player tests are resolved.Meaning to keep straight
Content.enrichmentTypes).Test plan
tscclean, lint 0 errors.?enrichment=TranscriptURL param survives a reload and back/forward.Notes
POST /object/enrichment/v4/listexposed through Kong. The badge lookup also needs EnrichmentObjects to be searchable through/composite/v1/search.^2.0.7. Bump it once an editor build containing generic-editor-v2#9 is published.