[Bug] Stories WebVTT import silently drops cues named STYLE or REGION
What happened?
Stories caption import silently drops an entire WebVTT cue when its identifier is STYLE or REGION, even when the next line is a valid cue timing line. The same file is parsed correctly by the backend subtitle parser used for dubbing.
This means changing only a cue identifier can remove spoken text from the imported script. In a mixed file the remaining cues are imported, so the omission can be easy to miss.
Reproduction
Save this as captions.vtt:
WEBVTT
STYLE
00:00:01.000 --> 00:00:02.000
Hello world.
next
00:00:03.000 --> 00:00:04.000
Still here.The Stories import path in longform-page.tsx calls importToText for .vtt files. With the frontend dependencies available, reproduce directly from the repository root:
node --input-type=module <<'JS'
import { importToText } from './electron/src/shared/utils/importStory.js';
for (const identifier of ['intro', 'STYLE', 'REGION']) {
const vtt = `WEBVTT\n\n${identifier}\n00:00:01.000 --> 00:00:02.000\nHello world.\n\nnext\n00:00:03.000 --> 00:00:04.000\nStill here.\n`;
console.log(identifier, JSON.stringify(importToText('captions.vtt', vtt)));
}
JSActual output:
intro "Hello world.\nStill here."
STYLE "Still here."
REGION "Still here."Expected: all three produce "Hello world.\nStill here.".
I also ran the same three inputs through backend.services.srt_parser.parse_srt: all three correctly return ['Hello world.', 'Still here.'].
Likely cause and suggested fix
captionBlocks filters solely by the first line. It removes the block before parseSrt can recognize the identifier followed by a timing line.
The backend already checks for a timing line in position two before treating the block as metadata, and test_webvtt_metadata_words_can_identify_a_cue covers this distinction. The WebVTT block parsing algorithm also checks the second-line timing before interpreting STYLE/REGION metadata.
Could the frontend apply the same timing-line distinction and add regression cases for these identifiers, while continuing to exclude actual CSS/region blocks? A shared frontend/backend fixture would help prevent this behavior from diverging again.
Environment / verification scope
- Reviewed
mainat0834c8be28460fc4e0518bdb31eb57c494b253b2(root package version 0.5.6). - macOS; Node.js v24.14.1; Python 3.14.3;
html-entities2.6.0. - Isolated execution of the unchanged frontend helper and backend parser. The frontend helper was copied byte-for-byte into a temporary dependency directory to avoid installing the complete desktop stack.
- No GPU/model or full desktop/audio-generation test was needed or performed. The UI import path was checked in source.
- Searched existing issues and open PRs. Related merged PR #2310 introduced the WebVTT Stories import handling, but this identifier case remains reproducible on the reviewed commit.
Source: debpalash/OmniVoice-Studio