Repository navigation
Fix timestamp editor reading short fractions as milliseconds - #1660
Open
Dev-next-gen wants to merge 1 commit into
Open
Dev-next-gen wants to merge 1 commit into
Dev-next-gen wants to merge 1 commit into
Conversation
Typing 00:00:05.5 in a segment start or end cell stored 5005 ms instead of 5500 ms, and 00:00:05.1234 stored 6234 ms. The digits after the dot were parsed as a whole number of milliseconds regardless of their count.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the transcription viewer, editing a segment's start or end cell and typing
00:00:05.5stores 5005 ms, not 5500 ms. On focus out the cell is redrawn as00:00:05.005. Typing00:00:05.1234stores 6234 ms, so the extra digit pushes the segment more than a second later.parse_timestampreads everything after the dot as a whole number of milliseconds (int("5"),int("1234")), whatever its length. The editor itself writes the fraction as three digits (to_timestamp), so05.5and05.005end up as the same value even though the cell shows05.500for half a second.The fix reads the fraction as a decimal: it is padded or cut to three digits before converting, so
.5is 500 ms,.45is 450 ms and.1234is 123 ms. Three-digit input such as01:23:45.678gives the same result as before.I added parser tests for short and long fractions and a
TimeStampLineEdittest that types00:00:05.5and fires a focus out. Before the change the three new tests fail (5005 != 5500,6234 != 5123, and the widget'sget_milliseconds()returns 5005). After it they pass, along with the other tests intranscription_segments_editor_widget_test.py(44 passed).Found by a defect-hunting pipeline I build and run (Dev-next-gen), using Claude Code with Anthropic's Claude Opus 5.5.