TT-7557 fix: scope Transcribe tasks to the step's language - #490
Draft
nabalone wants to merge 3 commits into
Draft
TT-7557 fix: scope Transcribe tasks to the step's language#490nabalone wants to merge 3 commits into
nabalone wants to merge 3 commits into
Conversation
A team can have a Phrase Back Translation record + transcribe step pair per language. Every PBT recording was showing up in every PBT Transcribe step, because the task list was built from plan media filtered only by artifact type. The Transcribe step's configured language now scopes the task list: when the step has a language set, only media tagged with that bcp47 become tasks, so each PBT Transcribe step shows its own recordings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A vernacular Transcribe step has no step language — it transcribes in the org vernacular, and its media carry no languagebcp47. If such a step's settings still held a leftover `language` value (e.g. the step was once a PBT step), the new filter scoped its task list to nothing. Every other consumer of stepLanguageBcp47 already bails without an artifactTypeId, so resolve it to undefined there instead of guarding at each call site. Found by the Devin review on PR #490. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Q&A and Retell transcribe steps use the org vernacular language too, so gate on artifactUsesOrgVernacularLanguage rather than a bare artifactTypeId check. The step editor only writes `language` for WBT / PBT / Careful Speech, so those steps can only carry one as leftover data after an artifact-type change — the same way a vernacular step can. Also reformat the new test file to the repo's Prettier width. Both from the Devin review on PR #490. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TT-7557 — a team can configure a Phrase Back Translation record + transcribe step pair per language (English, Arabic, French). Every PBT recording showed up in every PBT Transcribe step, because
TranscriberProviderbuilt its task list from plan media filtered only by artifact type.Change
The Transcribe step's configured language (
settings.language) now scopes the task list. When it is set (and notund), only media tagged with that bcp47 become tasks.matchesGuidedOutputRow.ts— extracted the language check intomediaMatchesStepLanguage(mediafile, stepLanguageBcp47);matchesGuidedOutputRowdelegates to it, so row-level and media-level filtering can't drift.TranscriberContext.tsx—TranscriberProvidertakes an optionalstepLanguageBcp47prop and applies the filter togetMediaInPlans(...)beforeplanMedia/planMediaRefare set, so everything downstream (addTasks→rowData, expanded groups, auto-selection,allDone, the Transcriber pane) only sees same-language media. The prop is in the effect deps, so switching steps re-derives the list.PassageDetailTranscribe.tsx— passes thestepLanguageBcp47it already computes from step settings (the same value drivingphraseRegionsandhasBtRecordings).Filtering at the source array rather than at render matters:
rowDataalso drives auto-selection and the Transcriber's own row lookup, so filtering inTaskListwould hide rows while still letting the pane load and save them.Vernacular steps are exempt (second commit)
A vernacular Transcribe step has no step language — it transcribes in the org vernacular, and its media carry no
languagebcp47. If such a step's settings still held a leftoverlanguagevalue (e.g. it was once a PBT step), the filter would scope its task list to nothing.stepLanguageBcp47now resolves toundefinedwithout anartifactTypeId; every other consumer of it already bailed in that case, so that memo is the single place to decide it. Raised by the Devin review on this PR.Notes
For non-vernacular artifact types the match is strict, so a recording with no
languagebcp47is dropped when the step has a language. That's the rulehasBtRecordingsalready applies to gate the whole pane, and the record step'splanLegacyPhraseBtClaimstamps untagged legacy outputs with the step language.Whole Back Translation steps also offer a language picker, and WBT recordings don't appear to be stamped with a language. That combination is already hidden by the pre-existing
hasBtRecordingsgate before the task list renders, so this PR doesn't change the visible outcome — but whether WBT should be language-scoped at all is worth a separate look.Test plan
npx jest src/components/PassageDetail— 34 suites, 217 tests pass, including newmatchesGuidedOutputRow.test.tscoverage formediaMatchesStepLanguage(unset/undstep language, matching tag, other language, untagged media).npm run typecheckclean.🤖 Generated with Claude Code