Skip to content

Commit 36bce87

Browse files
committed
fix(transcript): prioritize adapter text over media filenames in mirror resolution
1 parent 6c78fb6 commit 36bce87

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/config/sessions/transcript-mirror.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@ export function resolveMirroredTranscriptText(params: {
3535
text?: string;
3636
mediaUrls?: string[];
3737
}): string | null {
38+
const text = params.text ?? "";
39+
const trimmed = text.trim();
3840
const mediaUrls = params.mediaUrls?.filter((url) => url && url.trim()) ?? [];
41+
42+
// When adapter transcript text is present (e.g. component labels), use it as
43+
// the primary text and append media filenames as supplementary context.
44+
if (trimmed && mediaUrls.length > 0) {
45+
const names = mediaUrls
46+
.map((url) => extractFileNameFromMediaUrl(url))
47+
.filter((name): name is string => Boolean(name && name.trim()));
48+
const mediaSuffix = names.length > 0 ? names.join(", ") : "media";
49+
return `${trimmed}\n${mediaSuffix}`;
50+
}
51+
3952
if (mediaUrls.length > 0) {
4053
const names = mediaUrls
4154
.map((url) => extractFileNameFromMediaUrl(url))
@@ -46,7 +59,5 @@ export function resolveMirroredTranscriptText(params: {
4659
return "media";
4760
}
4861

49-
const text = params.text ?? "";
50-
const trimmed = text.trim();
5162
return trimmed ? trimmed : null;
5263
}

0 commit comments

Comments
 (0)