Repository navigation
Fix timestamp editor reading short fractions as milliseconds - #1660
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1660 +/- ##
==========================================
- Coverage 83.88% 83.20% -0.69%
==========================================
Files 115 115
Lines 13834 13835 +1
==========================================
- Hits 11605 11511 -94
- Misses 2229 2324 +95
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The red I couldn't find a Found by a defect-hunting pipeline I build and run (Dev-next-gen), using Claude Code with Anthropic's Claude Opus 5.5. |
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.