Skip to content

TT-7557 fix: scope Transcribe tasks to the step's language - #490

Draft
nabalone wants to merge 3 commits into
developfrom
TT-7557_pbt-audio-correct-transcribe-step
Draft

TT-7557 fix: scope Transcribe tasks to the step's language#490
nabalone wants to merge 3 commits into
developfrom
TT-7557_pbt-audio-correct-transcribe-step

Conversation

@nabalone

@nabalone nabalone commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

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 TranscriberProvider built 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 not und), only media tagged with that bcp47 become tasks.

  • matchesGuidedOutputRow.ts — extracted the language check into mediaMatchesStepLanguage(mediafile, stepLanguageBcp47); matchesGuidedOutputRow delegates to it, so row-level and media-level filtering can't drift.
  • TranscriberContext.tsxTranscriberProvider takes an optional stepLanguageBcp47 prop and applies the filter to getMediaInPlans(...) before planMedia / planMediaRef are set, so everything downstream (addTasksrowData, 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 the stepLanguageBcp47 it already computes from step settings (the same value driving phraseRegions and hasBtRecordings).

Filtering at the source array rather than at render matters: rowData also drives auto-selection and the Transcriber's own row lookup, so filtering in TaskList would 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 leftover language value (e.g. it was once a PBT step), the filter would scope its task list to nothing. stepLanguageBcp47 now resolves to undefined without an artifactTypeId; 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 languagebcp47 is dropped when the step has a language. That's the rule hasBtRecordings already applies to gate the whole pane, and the record step's planLegacyPhraseBtClaim stamps 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 hasBtRecordings gate 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 new matchesGuidedOutputRow.test.ts coverage for mediaMatchesStepLanguage (unset/und step language, matching tag, other language, untagged media).
  • npm run typecheck clean.
  • Manual: on a team with per-language PBT step pairs, record PBT audio in two languages for the same passage and confirm each PBT Transcribe step lists only its own recordings, and that the initially selected task belongs to that step. Also confirm a plain vernacular Transcribe step still lists its audio.

🤖 Generated with Claude Code

nabalone and others added 3 commits August 4, 2026 16:40
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant