fix(app-expo): allow read-aloud on other split segments while TTS paused
Match playback refs to the correct assistant segment so the interrupt overlay does not block other bubbles, and preempt local playback when switching segments. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,8 @@ import {
|
||||
assistantSegmentMessageId,
|
||||
lastSegmentPreview,
|
||||
normalizeAssistantContentForSplit,
|
||||
parseAssistantSplitListKey,
|
||||
playbackListKeyMatchesBubble,
|
||||
splitMessageParts,
|
||||
splitStreamingSegments,
|
||||
} from '@/features/conversation/message-split';
|
||||
@@ -75,6 +77,28 @@ describe('message-split', () => {
|
||||
expect(assistantSegmentMessageId('uuid-a', 1)).toBe('uuid-a_seg_1');
|
||||
});
|
||||
|
||||
it('playbackListKeyMatchesBubble aligns seg playback with part listKey', () => {
|
||||
const uuid = '78b32c06-d2f9-453b-9cc4-354e68fbcb2d';
|
||||
expect(
|
||||
playbackListKeyMatchesBubble(
|
||||
`${uuid}_seg_1`,
|
||||
`${uuid}_part_1`,
|
||||
uuid,
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
playbackListKeyMatchesBubble(
|
||||
`${uuid}_seg_0`,
|
||||
`${uuid}_part_1`,
|
||||
uuid,
|
||||
),
|
||||
).toBe(false);
|
||||
expect(parseAssistantSplitListKey(`${uuid}_part_0`)).toEqual({
|
||||
messageId: uuid,
|
||||
segmentIndex: 0,
|
||||
});
|
||||
});
|
||||
|
||||
it('normalizeAssistantContentForSplit maps fullwidth brackets', () => {
|
||||
expect(normalizeAssistantContentForSplit('[x]')).toBe('[x]');
|
||||
expect(normalizeAssistantContentForSplit('【x】')).toBe('[x]');
|
||||
|
||||
Reference in New Issue
Block a user