Skip to content

Tt 7873 multi verse marker incorrect after auto transcribe - #879

Open
sarahentzel wants to merge 2 commits into
developfrom
TT-7873
Open

sarahentzel wants to merge 2 commits into
developfrom
TT-7873

Conversation

@sarahentzel

Copy link
Copy Markdown
Collaborator

No description provided.

@sarahentzel
sarahentzel requested a review from gtryus November 13, 2026 20:55
@sarahentzel
sarahentzel marked this pull request as ready for review November 13, 2026 21:15
@sarahentzel sarahentzel changed the title Tt 7873 Tt 7873 multi verse marker incorrect after auto transcribe Nov 13, 2026

@gtryus gtryus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Duplicated pattern: the new verse-marker regex /\\v (\d+[a-f]?-?\d*[a-f]?)\s?/ repeats one in parseTranscription.ts:8, and the two already handle spaces differently. One shared constant would keep them in step.
  2. Missing test for empty input: nothing tests trans = ''. It currently returns undefined only because 'x'.includes('') is true.
  3. Names: appendAutoTranscription sounds like it changes something, but it only returns the text to add. autoTranscriptionToAppend would say that. m could be verseMarker.
  4. Comment is wrong: the doc comment says "leading verse marker", but the regex has no ^, so it matches the first marker anywhere in the text. Either anchor it or reword the comment.

(c) Implemented but looks wrong

  • Wrong cut point: in appendAutoTranscription.ts, index = m[0].length should be m.index + m[0].length. When the transcription doesn't start with a marker, the cut lands in the wrong place, e.g. foo \v 3 bar becomes v 3 bar. This was already in the old code.

  • Only the first marker is checked: if the pane already has \v 1-5 \v 6-7 , the transcription is appended whole and \v 6-7 appears twice.

  • Chapter is ignored: curTrans.includes(m[0]) can match chapter 6's \v 1 when looking for chapter 7's \v 1. This becomes a problem once Scenario 2 is fixed.

  • Newline after the marker: if the pane has \v 1-5\n, the match requires a trailing space, so the marker gets duplicated.

  • Moving the logic into a separate testable helper is a reasonable refactor.

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.

2 participants